In article <[email protected]>, Rhodri James <[email protected]> wrote: > >You'll note that this is, all Aaron's protests to the contrary, >splitting your class up into multiple cooperating classes.
Ayup. >If you're set on doing it like this, doing it this way avoids polluting >your namespace so much: > >class ClsB(object): > class ClsA(object): > def do_something(self): > print "Here's A doing something" > > def __init__(self): > self.A = ClsB.ClsA() > > def do_something(self): > print "Here's B doing something" Blech. The pollution caused by a separate class is minimal, and nested class definitions are likely to have problems (the most obvious is that pickling will break). -- Aahz ([email protected]) <*> http://www.pythoncraft.com/ Why is this newsgroup different from all other newsgroups? -- http://mail.python.org/mailman/listinfo/python-list
