ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> wxpython-users
wxpython-users
[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

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved