[Zope3-Users] Pure python packages for zope.component and zope.interface

Jim Fulton jim at zope.com
Sun Apr 20 12:42:09 EDT 2008

On Apr 20, 2008, at 12:06 AM, Darryl Cousins wrote:
> If I have understood the code correctly in zope.deferredimport the
> problem which zope.proxy.ProxyBase answers is in the following snippet
> from z.deferredimport.deferredmodule:initialize [1] where a  
> type(module)
> comparison is made.
> Therefore, if I could understand fully Jim's statement:
> "the inspect module's assumption that a module is not a module  
> unless it
> subclasses the standard Python module type"
> Then I could attempt to substitute pure-python code for the  
> type(module)
> problem which appears in the `initialize` method.

I'm not sure what you mean.  The idea is to provide a pure-python  
implementation of ModuleProxy.  ModuleProxy doesn't have to be as  
complete as zope.proxy allows.  The need for a proxy is due to the  
inspect module's use of isinstance.  isinstance in turn uses an  
object's __class__ attribute, which a proxy can override.

I hope this hint helps.


Jim Fulton
Zope Corporation

More information about the Zope3-users mailing list