Extending classes in Python
I tested today, and found that you can actually extend a class, on itself. Not just by using setattr(), but also by creating a new class:
>>> class bar: ... def monkey(self): ... print 'neat' ... >>> class bar(bar): ... def horse(self): ... print 'sweet' ... >>> bar().monkey() neat >>> bar().horse() sweet
Again, this might be in the manual, I just didn’t know of it until some ten minutes ago.