[issue6762] strange string representation of xrange in print

2009-08-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: I concur with Eric. The eval(repr(obj)) should be made to work when possible. We do this with itertools.count() and other places where it makes sense. -- nosy: +rhettinger ___ Python tracker

[issue6762] strange string representation of xrange in print

2009-08-22 Thread Mintaka
Mintaka added the comment: Thanks for clarification. I compared it with iter([0,1,2,3,4]).__str__() which behaviour seems to me closer then list or tuple. -- ___ Python tracker _

[issue6762] strange string representation of xrange in print

2009-08-22 Thread Eric Smith
Eric Smith added the comment: For types where it's possible, the str or repr returns a string that can be passed to eval: >>> for i in eval(str(xrange(5))): ... print i ... 0 1 2 3 4 xrange (and list, and tuple, and others) fall into this category. -- nosy: +eric.smith resolution:

[issue6762] strange string representation of xrange in print

2009-08-22 Thread Mintaka
Changes by Mintaka : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.or

[issue6762] strange string representation of xrange in print

2009-08-22 Thread Mintaka
New submission from Mintaka : String representation of xrange return keyword with value. foo = xrange(5) print foo >>> xrange(5) foo.__str__() >>> xrange(5) I think, that expected result should be somethink like this: >>> -- components: Interpreter Core messages: 91871 nosy: mintaka