Override a method in another module

Brian Quinlan brian at sweetapp.com
Tue Oct 1 19:14:17 EDT 2002


Chris Liechti wrote:
> > def F(self): pass
>
> hints:
> 1) setattr needs 3 args
> 2) eval works only for expressions and "def" is a keyword

The fact that "def" is a keyword is irrelevant. The following is an
equivalent expression that begins with a keyword:

lambda self: None

Cheers,
Brian





More information about the Python-list mailing list