Message196090
I noticed today that the builtin reversed() requires an explicit sequence and won't work with an iterator instead it throws a TypeError like:
>>> reversed(x for x in [1, 2, 3])
TypeError: argument to reversed() must be a sequence
It would be really great if reversed() worked on iterators too. Currently it requires an explicit list() before you can sent it back into reversed() which seems like it hurts readability.
For what it's worth I discovered this when trying to reverse the output of itertools.dropwhile. |
|
Date |
User |
Action |
Args |
2013-08-24 19:08:22 | dstufft | set | recipients:
+ dstufft |
2013-08-24 19:08:22 | dstufft | set | messageid: <1377371302.25.0.787358043575.issue18826@psf.upfronthosting.co.za> |
2013-08-24 19:08:22 | dstufft | link | issue18826 messages |
2013-08-24 19:08:22 | dstufft | create | |
|