This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author seesee
Recipients seesee
Date 2009-04-18.16:00:26
SpamBayes Score 1.110223e-16
Marked as misclassified No
Message-id <1240070428.04.0.628652917462.issue5786@psf.upfronthosting.co.za>
In-reply-to
Content
It seems python 2.6.2 (at least under Windows, I have not tested other
platforms) does break the len function on the reversed iterator:

Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit
(Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> len(reversed([1,2,3]))
3

Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit
(Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> len(reversed([1,2,3]))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: object of type 'listreverseiterator' has no len()

I don't think it was meant to work but it did in Python 2.6.1 (and 2.5
as shown above). I guess it has something to do with Issue #3689 and
guess __len__ was simply removed. 

Problem really is that Python 2.6.2 breaks backwards compatibility.
History
Date User Action Args
2009-04-18 16:00:28seeseesetrecipients: + seesee
2009-04-18 16:00:28seeseesetmessageid: <1240070428.04.0.628652917462.issue5786@psf.upfronthosting.co.za>
2009-04-18 16:00:27seeseelinkissue5786 messages
2009-04-18 16:00:26seeseecreate