[ python-Bugs-1506799 ] list bug
SourceForge.net
noreply at sourceforge.net
Thu Jun 15 19:03:19 CEST 2006
Bugs item #1506799, was opened at 2006-06-15 22:03
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1506799&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: SPlyer (splyer)
Assigned to: Nobody/Anonymous (nobody)
Summary: list bug
Initial Comment:
When i define class with list member(in class body, not
in __init__ or other method) that list become common
for all instances of the class. So when i change list
member in one instance it also will changed in all the
other instances. OS - Windows XP(SP2)
[code]
class TestClass:
t = []
def __init__ (self):
pass
a = TestClass()
b = TestClass()
a.t.append(123)
print b.t
[/code]
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1506799&group_id=5470
More information about the Python-bugs-list
mailing list