New submission from xBrawny <and...@newthot.com>:

I wonder if this is the desired behavior. According to docs, __instancecheck__ 
should be called,  but it never gets to it. If "return True" is replaced with 
"raise Exception" the result is the same.
=========================================
class M(type):
    def __instancecheck__(cls,obj):
        return True
    
class P(M):
    __metaclass__=M

isinstance(object,P)
========================================
    isinstance(object,P)
RuntimeError: maximum recursion depth exceeded while calling a Python object

----------
components: Interpreter Core
messages: 133110
nosy: xBrawny
priority: normal
severity: normal
status: open
title: __subclasscheck__ :  class P(M): __metaclass__=M causes maximum 
recursion depth exceeded.
type: behavior
versions: Python 2.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11778>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to