On Sat, Jun 7, 2014 at 10:14 AM, Dan Stromberg <drsali...@gmail.com> wrote:
> 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.

Since decoration happens at class creation, and arguments like self
are available only when the method's actually called, no, there's no
way you can define the method with something using information that
doesn't exist yet and may change from one call to the next :)

What are you trying to do, exactly?


Reply via email to