A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-June/066601.html below:

[Python-Dev] Semantic of isinstance

[Python-Dev] Semantic of isinstance [Python-Dev] Semantic of isinstanceGuido van Rossum guido at python.org
Tue Jun 27 07:13:51 CEST 2006
On 6/26/06, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Phillip J. Eby wrote:
>
> > It's not inconsistent - isinstance() checks __class__ in *addition* to
> > type() in order to allow proxying tricks like lying about your
> > __class__.
>
> If this is a deliberate feature, it's a bit patchy, because
> it means the proxy can't lie about *not* being an instance
> of its real type.
>
> Perhaps Guido could clarify how much lying a proxy is
> supposed to be able to get away with?

Sorry, I don't remember all the constraints. Read the code and weep.
This should be revisited for Py3k. The code became convoluted out of
some needs in Zope; I can't remember if it was Zope 2 or Zope 3 that
needed this (probably both) and I can't remember the specific
situation where it was needed.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4