Andres Freund wrote:

Dominik Huber wrote:

You can use zapi.isinstance ( orig. place). This function is useful because it works even if the instance is security proxied.

I know that from irc but there are two issues:
-Fixing that in foreign code is dirty and error prone. In my own code i wouldn't have a problem with it.

-Why not fix it in the proxies if the problem can be solved? Thats the way much more clean way i think. You don't want to learn new ways, if the old ones can be made compatible.

For now i fixed that through monkey patching, but i don't like that.

This can't be fixed by changing the proxy behavior.  Security proxies
expose a valid __class__ attribute except that it is security proxied.
It isn't valid to change this.  Unfortunately, the standard Python isinstance
requires that the value if the __class__ attribute is a known class
type.  It does this because it uses internal C data structures of types
which it can't get to through a proxy.


Jim Fulton           mailto:[EMAIL PROTECTED]       Python Powered!
CTO                  (540) 361-1714  
Zope Corporation
Zope3-dev mailing list

Reply via email to