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/066597.html below:

[Python-Dev] Semantic of isinstance

[Python-Dev] Semantic of isinstance [Python-Dev] Semantic of isinstancePhillip J. Eby pje at telecommunity.com
Tue Jun 27 05:41:17 CEST 2006
At 08:04 PM 6/26/2006 -0700, Martin Maly wrote:
>Thanks for the response. The code snippet I sent deals with new style 
>classes only so I assume that in some cases isinstance falls back to 
>old-style-like handling which then asks for __bases__ and __class__ etc, 
>possibly incorrectly so on new style classes.

Actually, it's correct behavior for isinstance() to inspect __class__, even 
on new-style classes.  I suspect that the question of checking for 
__bases__ in one of the shortcut branches just didn't come up when the code 
was being written.  This does appear to be a language design question, 
regarding how much of this machinery one is allowed to emulate.

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