This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author emanspeaks
Recipients emanspeaks
Date 2019-05-11.02:29:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1557541744.61.0.162387429511.issue36881@roundup.psfhosted.org>
In-reply-to
Content
>>> from abc import ABCMeta
>>> class AbstractMeta(type, metaclass=ABCMeta): pass
...
>>> class Meta1(AbstractMeta): pass
...
>>> class Meta2(AbstractMeta): pass
...
>>> class ClassA(metaclass=Meta1): pass
...
>>> isinstance(ClassA, Meta2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\miniconda\miniconda3\lib\abc.py", line 139, in __instancecheck__
    return _abc_instancecheck(cls, instance)
TypeError: __subclasscheck__() takes exactly one argument (0 given)


This is driven by the fact that the metaclass of AbstractMeta is ABCMeta; if I change its metaclass to something else that does not contain ABCMeta in the inheritance chain, isinstance returns False as expected.


Possibly related to Issue 2325?
History
Date User Action Args
2019-05-11 02:29:04emanspeakssetrecipients: + emanspeaks
2019-05-11 02:29:04emanspeakssetmessageid: <1557541744.61.0.162387429511.issue36881@roundup.psfhosted.org>
2019-05-11 02:29:04emanspeakslinkissue36881 messages
2019-05-11 02:29:04emanspeakscreate