[Python-Dev] Issue 643841: Including a new-style proxy base class in 2.6/3.0

Fred Drake fdrake at acm.org
Wed May 21 13:36:19 CEST 2008


On May 21, 2008, at 5:41 AM, Nick Coghlan wrote:
> While a proxy class written in C would no doubt be faster than one  
> written in Python, one of the things I'm hoping to achieve is for  
> the stdlib generic proxy to serve as an example for people writing  
> their own new-style proxy classes in addition to being usable as a  
> base class (Adam Olsen suggested ProxyMixin instead of ProxyBase as  
> a possible name).


The idea that it would serve as an example seems odd; the reason to  
make things part of the standard library is because their  
implementation needs to track the Python core closely.  For a proxy,  
it would be the need to reflect additional slot methods as they're  
added.  A Python implementation may be able to do this just fine, but  
the performance penalty would make it uninteresting for many large  
applications.

For what it's worth, zope.proxy does support subclassing.


   -Fred

-- 
Fred Drake   <fdrake at acm.org>






More information about the Python-Dev mailing list