New submission from Austin Howard <austin1how...@gmail.com>: When creating a class which contains elements that are lists, the lists for different instances of the class are not independent. Calling self.mylist.append(3) inside a class method will update the mylist variable for *all* instances of the class, not just the current instance. Attached is a script which demonstrates this behavior.
---------- components: Interpreter Core files: python_bug.py messages: 137410 nosy: austin1howard priority: normal severity: normal status: open title: Lists in class objects not independent type: behavior versions: Python 2.6 Added file: http://bugs.python.org/file22218/python_bug.py _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue12233> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com