Message86122
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. |
|
Date |
User |
Action |
Args |
2009-04-18 16:00:28 | seesee | set | recipients:
+ seesee |
2009-04-18 16:00:28 | seesee | set | messageid: <1240070428.04.0.628652917462.issue5786@psf.upfronthosting.co.za> |
2009-04-18 16:00:27 | seesee | link | issue5786 messages |
2009-04-18 16:00:26 | seesee | create | |
|