Amaury Forgeot d'Arc <amaur...@gmail.com> added the comment:

This is a bug in the script; the code is similar to the following::

  >>> funclist = []
  >>> global_list = []
  >>> funclist.append(global_list)
  >>> global_list.append(1)
  >>> funclist.append(global_list)
  >>> print funclist
  [[1], [1]]

i.e the same object is added twice to "funclist", any modification to the first 
item is a modification to the second. See also 
http://www.python.org/doc//current/faq/programming.html#how-do-i-create-a-multidimensional-list
In your script, it's certainly happens because there are multiple nested blocks 
('{' '}') in the same function ('$FUNC'), so global_list is still the *same* 
list.

----------
nosy: +amaury.forgeotdarc
resolution:  -> invalid
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13006>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to