multi-level hierarchies of TypedDict no longer return superclass elements in __annotations__ as of 3.14.0b1 when future annotations enabled #133701
Labels
3.14
bugs and security fixes
stdlib
Python modules in the Lib dir
topic-typing
type-bug
An unexpected behavior, bug, or error
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug description:
using
get_annotations()
or accessing__annotations__
directly on aTypedDict
subclass previously returned a dictionary of all attributes in the TypedDict hierarchy, now only returns for the sub-most class. only happens whenfrom __future__ import annotations
is used; when not used, then it works as previously. there's no workaround here because the typeddict subclass does not include declared superclasses in its__mro__
.CPython versions tested on:
3.14
Operating systems tested on:
No response
Linked PRs
__annotations__
on TypedDict defined under PEP 563 #133772__annotations__
on TypedDict defined under PEP 563 (GH-133772) #134003The text was updated successfully, but these errors were encountered: