You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Magic class member variable initialization with lists #45784
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2007-11-14.19:19:50.559>created_at=<Date2007-11-14.19:10:35.370>labels= ['interpreter-core', 'type-bug', 'invalid']
title='Magic class member variable initialization with lists'updated_at=<Date2007-11-14.19:19:50.530>user='https://bugs.python.org/neoone'
Activity
neoone commentedon Nov 14, 2007
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
gvanrossum commentedon Nov 14, 2007
Go ask on c.l.py why this is not a bug.