[New-bugs-announce] [issue12233] Lists in class objects not independent

Austin Howard report at bugs.python.org
Wed Jun 1 03:39:53 CEST 2011

New submission from Austin Howard <austin1howard at gmail.com>:

When creating a class which contains elements that are lists, the lists for different instances of the class are not independent. Calling
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 <report at bugs.python.org>

More information about the New-bugs-announce mailing list