Decorating one method of a class C with another method of class C?

Dan Stromberg drsalists at gmail.com
Fri Jun 6 20:14:54 EDT 2014


Is there a way of decorating method1 of class C using method2 of class C?

It seems like there's a chicken-and-the-egg problem; the class doesn't
seem to know what "self" is until later in execution so there's
apparently no way to specify @self.method2 when def'ing method1.



More information about the Python-list mailing list