Metaclass with name overloading.

Carlos Ribeiro carribeiro at gmail.com
Mon Sep 27 10:13:17 EDT 2004


On Mon, 27 Sep 2004 15:27:31 +0200, Alex Martelli <aleaxit at yahoo.com> wrote:
> > 1) One such idea is to provide the metaclass with a __dict__ factory.
> 
> If you go that route, then it may indeed require changes too deep for
> 2.5 or 2.anything.  The metaclass gets determined later, at the time
> CALL_FUNCTION executes the metaclass ain't in play yet.
> 
> > By using a user-defined dict, we would still use the default dict most
> > of the time without any noticeable performance hit, but would be able
> > to change the guts of the class declaration system whenever needed.
> 
> Yeah, but if you make it a metaclass's job, then you're indeed asking
> for deep changes from today's architecture.

Yes, that's why I said that I don't think this is possible in a short
time frame. But for now, I have only one question. You said that the
metaclass is determined later. I'm not familiar with Python's
internals, but I (naively?) assumed that the metaclass is known very
early in the class declaration process. Is that wrong?

obs 1: If it's possible to determine the metaclass *early*, then it's
no problem to call any extra function to provide the f_locals dict, or
to provide an augmented dict.


-- 
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