Issue 1443: Magic class member variable initialization with lists (original) (raw)

Issue1443

Created on 2007-11-14 19:10 by neoone, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test.py neoone,2007-11-14 19:10
Messages (2)
msg57500 - (view) Author: neoone (neoone) Date: 2007-11-14 19:10
Initialization of member variables with lists leads to strange behavior. The list object is common to each instance of that class. File attached results in: [] [] <__main__.Proof instance at 0x00BA7120> ['STICKYARRAY'] [] <__main__.Proof instance at 0x00BA7148> So the initialized list a is the same in both instances. Behaviour has been tested on 2.3 and 2.5
msg57502 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-11-14 19:19
Go ask on c.l.py why this is not a bug.
History
Date User Action Args
2022-04-11 14:56:28 admin set github: 45784
2007-11-14 19:19:50 gvanrossum set status: open -> closedresolution: not a bugmessages: + nosy: + gvanrossum
2007-11-14 19:10:35 neoone create