On 1/20/06, Michele Cella <[EMAIL PROTECTED]> wrote:
> But is this possible to do? otherwise seems like a nice solution,  it's
> also less magic since with the actual style:

I'd prefer Jeff's syntax to the current, but it'd be even trickier
than the current code.


The current code checks the attributes of a class when it's
instantiated and if they're a Widget, moves them to the internal
_widgets list (which is the same that is populated either way). If you
were to do it without the attributes you'd have to somehow detect that
you were within a class context in the Widget __classinit__ and call
some method on the containing widget in order to register yourself.
Alternatively you'd have to detect that there are widgets declared
inside the outer scope.

Either way, I don't see how you're going to do it without mucking
around with interpreter guts. Maybe it'd be possible if you were using
some global value but that seems excessively hackish. I won't say it
can't be done, but I'm curious to hear your plan.

Reply via email to