Yu-Jie Lin wrote on 2011-08-17 00:59: > class CPDict(dict): > """Cascading (Escape) Palette for Pygments token > > Only works if ancestor is already defined. > """ > def __contains__(self, k): ...
I've heard that it's a bad idea to subclass dict (or any of the standard python containers) unless you override pretty much every special method. Their implementations assume that the methods haven't been changed in a subclass, and you might get surprising behaviour. Ian _______________________________________________ Urwid mailing list [email protected] http://lists.excess.org/mailman/listinfo/urwid
