[New-bugs-announce] [issue1443] Magic class member variable initialization with lists

neoone report at bugs.python.org
Wed Nov 14 20:10:35 CET 2007


New submission from neoone:

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

----------
components: Interpreter Core
files: test.py
messages: 57500
nosy: neoone
severity: normal
status: open
title: Magic class member variable initialization with lists
type: behavior
versions: Python 2.5
Added file: http://bugs.python.org/file8745/test.py

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1443>
__________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.py
Type: application/octet-stream
Size: 244 bytes
Desc: not available
Url : http://mail.python.org/pipermail/new-bugs-announce/attachments/20071114/2bffb94f/attachment.obj 


More information about the New-bugs-announce mailing list