[ZODB-Dev] Persistent-derived class instances always callable

Phillip J. Eby pje at telecommunity.com
Tue Oct 21 11:55:40 EDT 2003


At 10:00 AM 10/21/03 -0400, Shane Hathaway wrote:
>On Tue, 21 Oct 2003, Phillip J. Eby wrote:
>
> > AOP is in as fragmented a state as OOP was back in the days when new
> > experimental OO languages were springing up every month or so, and people
> > are still putting forth ideas about what AOP *is*.  So, it's virtually
> > impossible to say anything really specific about AOP right now.
>
>Ok.
>
> > (Btw, aspects aren't *that* new.  I remember reading papers on it back in
> > 1997, and research may go back even further.)
>
>That sounds very new to me. :-)

Well, if you look at in Python version terms, that was when Python 1.4 was 
the latest version, so that sounds really old to me.  ;)  Heck, it's older 
than Zope, and perhaps at least as old as Principia.


> > So, if you want to make *really* transparent proxies for any possible
> > object type, you really need to be dynamically generating them already 
> anyway.
>
>That means it's going to become progressively more expensive to create a
>proxy.  Oh, well.

Yep.  It'd be nice if 'type' had some kind of mechanism to allow "slot 
listeners" other than subclasses, as then you could dynamically update a 
proxy class when the original class changed.  But, for most Python programs 
it's probably sufficient to generate a proxy class once for a given target 
class.  I doubt it's necessary to generate a proxy class for each instance, 
so in practice all we're talking about in the typical case is a dictionary 
lookup to find the already-cached proxy class for the target class.

Hopefully, there will be more core support for proxy objects and creating 
proxy types in the future.  But, it will need to be based on dynamic 
proxying because it's already way, way too late in Python's evolution to 
avoid type slot introspection in C code.




More information about the ZODB-Dev mailing list