[issue1603] Wanted behaviour ?

Stefan Sonnenberg-Carstens report at bugs.python.org
Wed Dec 12 11:04:46 CET 2007


New submission from Stefan Sonnenberg-Carstens:

>>> a = {}
>>> a['a'] = [1,2,3,4,5]
>>> a['b'] = [1,2,3,4,5]
>>> a['c'] = [1,2,3,4,5]
>>> for k in a.keys():
...     print a[k]
...     for t in a[k]:
...             del a[k][a[k].index(t)]
...             print a[k]
...
[1, 2, 3, 4, 5]
[2, 3, 4, 5]
[2, 4, 5]
[2, 4]
[1, 2, 3, 4, 5]
[2, 3, 4, 5]
[2, 4, 5]
[2, 4]
[1, 2, 3, 4, 5]
[2, 3, 4, 5]
[2, 4, 5]
[2, 4]

Does this make sense ?

----------
messages: 58488
nosy: pythonmeister
severity: normal
status: open
title: Wanted behaviour ?
type: behavior
versions: Python 2.3

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1603>
__________________________________


More information about the Python-bugs-list mailing list