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.

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to