[issue44919] TypedDict subtypes ignore any other metaclasses in 3.9+
Łukasz Langa
report at bugs.python.org
Tue Sep 28 10:59:25 EDT 2021
Łukasz Langa <lukasz at langa.pl> added the comment:
The change to disallow this in Python 3.9 was deliberate, see BPO-40187 and its description.
Your attempt to make `isinstance()` work with TypedDict subclasses goes directly against this design. In fact, PEP 589 explicitly says that:
- Methods are not allowed, since the runtime type of a TypedDict object will always be just dict (it is never a subclass of dict).
- Specifying a metaclass is not allowed.
I'm -1 to allow this but I'll also wait for Serhiy to voice his opinion.
----------
nosy: +lukasz.langa, serhiy.storchaka
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44919>
_______________________________________
More information about the Python-bugs-list
mailing list