[New-bugs-announce] [issue7886] reverse on an empty list returns None

tormen report at bugs.python.org
Mon Feb 8 20:03:43 CET 2010


New submission from tormen <tormen at gmx.net>:

# python 3.1.1:

myList = []
for item in myList:
    print( item ) # <<< works

for item in myList.reverse(): # <<< breaks with: TypeError: 'NoneType' object is not iterable
    print( item ) #

# But the reverse of an empty list should really be an empty list
# ... or do I miss something here?

----------
messages: 99059
nosy: tormen
severity: normal
status: open
title: reverse on an empty list returns None
type: behavior
versions: Python 3.1

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


More information about the New-bugs-announce mailing list