[wxpython-users] Static variables in wx.Python?
by Raffaello other posts by this author
May 7 2008 3:44PM messages near this date
Re: [wxpython-users] wx.grid with wx.GridTableBase: col/row inserting/deleting
|
Re: [wxpython-users] Static variables in wx.Python?
Many of my frames are subclassed from a more generic one. With variables
declared at class level (before the __init__ method) something occurs that
is not completely clear to me. While strings, integers, floating point
objects and the like at the second or third subclassing start always with
the original value, lists seem to conserve the values acquired in the former
subclassings, i.e. they seem to behave like a static variable in C++. The
variable was originally declared so:
ButtonsInLine = []
My OS is Windows XP, python version 2.5, wx.Python version 2.8
I have solved the problem, for the moment, re-declaring the list in
__init__, but I feel uneasy with just an empiric solution. Thanks in
advance for any explanation.
Thread:
Raffaello
Mark Erbaugh
Christopher Barker
|