[New-bugs-announce] [issue43594] A metaclass that inherits both `ABC` and `ABCMeta` breaks on `__subclasscheck__`

Erez Zinman report at bugs.python.org
Mon Mar 22 09:42:00 EDT 2021


New submission from Erez Zinman <erezinman.programmer at gmail.com>:

Consider the following example:

```
from abc import ABCMeta, ABC

class MetaclassMixin(ABC):
    pass 

class Meta(MetaclassMixin, ABCMeta):
    pass

class A(metaclass=Meta):
    pass

```

Then the call `isinstance(A, Meta)` returns `True` but `isinstance(1, Meta)` raises 

 >>> TypeError: __subclasscheck__() missing 1 required positional argument: 'subclass'

Checked on 3.6.9, 3.8.0 & 3.8.8

----------
components: Library (Lib)
messages: 389314
nosy: erezinman
priority: normal
severity: normal
status: open
title: A metaclass that inherits both `ABC`  and `ABCMeta` breaks on `__subclasscheck__`
versions: Python 3.6, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43594>
_______________________________________


More information about the New-bugs-announce mailing list