[Python-Dev] printing xrange objects (original) (raw)
Fred L. Drake, Jr. fdrake@beopen.com
Thu, 3 Aug 2000 11:14:57 -0400 (EDT)
- Previous message: [Python-Dev] printing xrange objects
- Next message: [Python-Dev] printing xrange objects
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Thomas Wouters writes:
x = xrange(1000) repr(x) (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, ... ... ... ... 998, 999)
str(x) '(xrange(0, 1000, 1) * 1)'
What version is this with? 1.5.2 gives me:
Python 1.5.2 (#1, May 9 2000, 15:05:56) [GCC 2.95.3 19991030 (prerelease)] on linux-i386 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
x = xrange(2) str(x) '(xrange(0, 2, 1) * 1)' repr(x) '(xrange(0, 2, 1) * 1)' x (0, 1)
The 1.6b1 that's getting itself ready says this:
Python 1.6b1 (#19, Aug 2 2000, 01:11:29) [GCC 2.95.3 19991030 (prerelease)] on linux2 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam Copyright 1995-2000 Corporation for National Research Initiatives (CNRI) Module readline not available.
x = xrange(2) str(x) '(xrange(0, 2, 1) * 1)' repr(x) '(xrange(0, 2, 1) * 1)' x (0, 1)
What I'm proposing is:
Python 2.0b1 (#116, Aug 2 2000, 15:35:35) [GCC 2.95.3 19991030 (prerelease)] on linux2 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam Copyright 1995-2000 Corporation for National Research Initiatives (CNRI)
x = xrange(2) str(x) 'xrange(0, 2, 1)' repr(x) 'xrange(0, 2, 1)' x xrange(0, 2, 1)
(Where the outer (... * n) is added only when n != 1, 'cause I think that's just ugly.)
-Fred
-- Fred L. Drake, Jr. BeOpen PythonLabs Team Member
- Previous message: [Python-Dev] printing xrange objects
- Next message: [Python-Dev] printing xrange objects
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]