[New-bugs-announce] [issue46445] Multiple inheritance of TypedDict is not covered in `test_typing`

Nikita Sobolev report at bugs.python.org
Thu Jan 20 10:52:23 EST 2022


New submission from Nikita Sobolev <mail at sobolevn.me>:

Why is this important?
1. Because multiple inheritance of `TypedDict` might not handle `__required_keys__`, or `__optional_keys__`, or `__annotations__` correctly, this is especially important because some classes might be defined as `total=False` and some as `total=True`
2. Some classes might be defined inline as `T = TypedDict('T', ...)`
3. Moreover, we have a special error we have to check: all superclasses must be `TypedDict`s as well (coverage shows that this error is not covered) https://github.com/python/cpython/blob/650720a0cfa1673938e6d1bad53b6c37c9edb47d/Lib/typing.py#L2328-L2331

I will send a PR for this.

----------
components: Tests
messages: 411030
nosy: sobolevn
priority: normal
severity: normal
status: open
title: Multiple inheritance of TypedDict is not covered in `test_typing`
type: behavior
versions: Python 3.11

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


More information about the New-bugs-announce mailing list