As Attila pointed out, zope.proxy is possible to implement using
if you only want some limited zope.proxy support.  You won't get
zope.security going down
this path.

I do that specifically so that I can use zope.deferredimport on app engine.

Below is the awful hacking I do to zope.proxy.__init__ to make it
support zope.deferredimport on appengine.




from zope.interface import moduleProvides
from zope.proxy.interfaces import IProxyIntrospection

from peak.util.proxies import ObjectProxy

class ProxyBase(ObjectProxy):

def getProxiedObject(obj):

     if hasattr(obj,'__subject__'):
         return obj.__subject__
         return obj

def removeAllProxies(obj):
    return getProxiedObject(obj)

def sameProxiedObjects(obj1,obj2):
    if getProxiedObject(obj1) == getProxiedObject(obj2):
        return True
        return False

__all__ = tuple(IProxyIntrospection)

def ProxyIterator(p):
    yield p
    while isProxy(p):
        p = getProxiedObject(p)
        yield p

def non_overridable(func):
    return property(lambda self: func.__get__(self))

On Wed, Mar 10, 2010 at 1:03 AM, Jim Fulton <j...@zope.com> wrote:
> On Tue, Mar 9, 2010 at 10:53 AM, Baiju M <mba...@zeomega.com> wrote:
>> Hi,
>>   Any idea how difficult it is to create optional C extensions
>> for these packages:
>> zope.container
>> zope.hookable
>> zope.proxy
>> zope.security
> I believe it is very hard, if not impossible, for zope.proxy and
> zope.security.  I suspect the best approach would be to make a new
> package (or set of packages) that provides everything that
> zope.security providex except the zope.security.proxy package.  If I
> were going to do that though, I would rethink the way proxies and
> checkers are managed.
> Jim
> --
> Jim Fulton
> _______________________________________________
> Zope-Dev maillist  -  zope-...@zope.org
> https://mail.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists -
>  https://mail.zope.org/mailman/listinfo/zope-announce
>  https://mail.zope.org/mailman/listinfo/zope )
Zope-Dev maillist  -  Zope-Dev@zope.org
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope )

Reply via email to