[Python-3000] ABC PEP isinstance issue Was: PEP 31XX: A Type Hierarchy for Numbers (and other algebraic entities)

Phillip J. Eby pje at telecommunity.com
Sat Apr 28 23:17:38 CEST 2007

At 09:17 AM 4/28/2007 -0700, Guido van Rossum wrote:
>On 4/28/07, Jean-Paul Calderone <exarkun at divmod.com> wrote:
> > Aside from the way in which `x' can already lie:
> >
> >     >>> class X(object):
> >     ...     __class__ = property(lambda self: int)
> >     ...
> >     >>> isinstance(X(), int)
> >     True
> >     >>>
> >
> > Is this behavior changed/going to be changed in Py3k?
>I'm not particularly enamored with it, but I believe it once served a
>purpose for Zope. Does anyone know if it is still needed?

AFAIK, it's still used to support proxies in Zope 3, and my own ProxyTypes 
library on the Cheeseshop (and some other libraries I've written that use 
it) depend on it.  I believe Chandler uses this, too.

In all cases, it's to allow proxies to appear to be the object they're 
proxying.  I wouldn't be surprised if weakref.proxy does the same thing.

More information about the Python-3000 mailing list