This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author zero79
Recipients zero79
Date 2009-04-23.19:15:30
SpamBayes Score 5.7444023e-08
Marked as misclassified No
Message-id <1240514133.74.0.0123263268481.issue5822@psf.upfronthosting.co.za>
In-reply-to
Content
using range in combination with remove is inconsistent.  for example in 
python 2.x:

>>> x = range(0,3)
>>> x.remove(1)
>>> x
[0, 2]
>>> x = range(0,3).remove(1)
>>> x
>>>

and in python 3.x:
>>> x = list(range(0,3))
>>> x.remove(1)
>>> x
[0, 2]
>>> x = list(range(0,3)).remove(1)
>>> x
>>> 

why does the second approach remove all items from the list?
History
Date User Action Args
2009-04-23 19:15:33zero79setrecipients: + zero79
2009-04-23 19:15:33zero79setmessageid: <1240514133.74.0.0123263268481.issue5822@psf.upfronthosting.co.za>
2009-04-23 19:15:31zero79linkissue5822 messages
2009-04-23 19:15:30zero79create