[New-bugs-announce] [issue3689] reversed() not working as intended on lists

Jeff Hall report at bugs.python.org
Tue Aug 26 22:17:15 CEST 2008


New submission from Jeff Hall <hall.jeff at gmail.com>:

reversed() built in is not functioning correctly with list (specifically
with len() )

l = [1,2,3,4]
rl = reversed(l)

type(rl)
<type 'listreverseiterator'>

vs. strings and tuples which just return 'reverse' objects

listreverseiterators apparently have a len() defined that changes with
each .next() call

----------
messages: 71993
nosy: laxrulz777
severity: normal
status: open
title: reversed() not working as intended on lists
type: behavior
versions: Python 2.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3689>
_______________________________________


More information about the New-bugs-announce mailing list