Christian Heimes added the comment:
It's a classic problem for new Python developers. You have declared a
mutable object at class level. styles and widgets are the same object
for all instances of Widget and Container. You have to create them
inside the initializer.
Try
class Widget:
def __
New submission from Heather:
I have tried both Python 2.4.4 and 2.5.1 and for both, I get the
following results when running the following code:
IDLE 1.2.1
>>> class Style:
stylename=''
value=''
>>> class Widget:
styles = {}
def setStyle(self, stylename, value):