Unless I'm misconstruing something the problem is that reversed returns two different object types depending on if it's a list or a tuple >>> l = [1,2,3,4] >>> i = iter(l) >>> ri = reversed(l) >>> l [1, 2, 3, 4] >>> ri <listreverseiterator object at 0x00D5C8F0> >>> i <listiterator object at 0x00D5C3F0> >>> t = (1,2,3,4) >>> it = iter(t) >>> rit = reversed(t) >>> it <tupleiterator object at 0x00D5C030> >>> rit <reversed object at 0x00D5CC90> >>> reversing a tuple (or a string) returns a "reversed object" reversing a list returns a "listreverseiterator" definitely an inconsistency -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20080826/9b0d71f1/attachment.htm>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4