> Instance variables are properly created in the __init__() > initializer method, *not* directly in the class body. > > Your class would be correctly rewritten as: > > class MyClass2(object): > def __init__(self): > self.mySet = sets.Set(range(1,10)) > > def clearSet(self): > # ...rest same as before...
Thanks Chris. That was certainly very helpful!! So just out of curiosity, why does it work as I had expected when the member contains an integer, but not when the member contains a set? -- http://mail.python.org/mailman/listinfo/python-list