up with PyGUI!

Carlos Ribeiro carribeiro at gmail.com
Sun Sep 26 06:33:15 CEST 2004

On Sat, 25 Sep 2004 21:58:02 -0400, Ed Leafe <ed at leafe.com> wrote:
>         Sorry, but it just doesn't seem explicit to me. Defining a class
> doesn't mean instantiating one instance of a class at the place where
> the class is defined, but that seems to be exactly what your metaclass
> constructor does.

I'm not entirely satisfied with it either, but I'm trying to be
pragmatic and to keep a neutral stance on this. I just thought about a
slightly different approach to the problem; I don't know if I can make
it work, but it may be a good solution.

Imagine if, instead of instantiating the inner classes automatically
when the outer class is declared, the process is deferred until the
outer class is instantiated. In this way, the outer class would still
contain just classes; but the instance would contain only instances.
It's a relatively small change, and it's still different from the
usual class creation stuff, but it's less of a surprise.
>         I understand that it's an experiment. My question is if the goal of
> this experiment is just to do something differently, or if there is an
> ultimate benefit that one can hope to gain if the experiment is a
> success. I see what you're doing and how it is different; I guess I
> still don't see that this is gaining any power or flexibility.

No, it's not just to do something different. I hope to be able to
develop a system that is more readable and more flexible than the
traditional approach. OKB already did a good job of explaining some of
the advantages. I would like to sum it up this way: there is a lot of
information encoded in the way the classes are structured that you
have to spell explicitly with the traditional form. That's a big gain.

Carlos Ribeiro
Consultoria em Projetos
blog: http://rascunhosrotos.blogspot.com
blog: http://pythonnotes.blogspot.com
mail: carribeiro at gmail.com
mail: carribeiro at yahoo.com

More information about the Python-list mailing list