New submission from Michael Gilbert <michael.s.gilb...@gmail.com>: 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? ---------- components: Interpreter Core messages: 86372 nosy: zero79 severity: normal status: open title: inconsistent behavior of range when used in combination with remove type: behavior versions: Python 2.5, Python 2.6, Python 3.0, Python 3.1 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5822> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com