[Baypiggies] puzzle: binding invocation context for a function call during a class declaration

Bill Janssen janssen at parc.com
Wed Jan 5 00:42:14 CET 2011


Tim Hatch <tim at timhatch.com> wrote:

> >   class Bletch (Expression):
> > 
> >     expresses(Foo)
> >     counter = 3
> 
> It took me a second to remember where I'd seen that syntax before.  It's
> how Trac handles its component registry -- for example
> http://trac.edgewall.org/browser/trunk/trac/attachment.py?marks=352-357#L348
> 
> The code behind it is at
> http://trac.edgewall.org/browser/trunk/trac/core.py?marks=86-169#L84 and
> appears to be using stack introspection as well.

Ah, another use case.  Thanks, Tim.

Bill


More information about the Baypiggies mailing list