Thanks to visit codestin.com
Credit goes to github.com

Skip to content

TypedDict.__annotations__ is empty with Python 3.14 beta 1 #593

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
pekkaklarck opened this issue May 8, 2025 · 2 comments
Open

TypedDict.__annotations__ is empty with Python 3.14 beta 1 #593

pekkaklarck opened this issue May 8, 2025 · 2 comments

Comments

@pekkaklarck
Copy link

Python 3.14.0b1 (main, May  8 2025, 08:57:13) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from typing_extensions import TypedDict
>>> 
>>> class XY(TypedDict):
...     x: int
...     y: int
...     
>>> XY.__annotations__
{}
>>> 
>>> from typing import TypedDict
>>> 
>>> class XY(TypedDict):
...     x: int
...     y: int
...     
>>> XY.__annotations__
{'x': <class 'int'>, 'y': <class 'int'>}
>>> 

Tested with typing_extensions v4.13.2. There are no problems with earlier Python versions nor were there with Python 3.14 alphas that I tested.

@JelleZijlstra
Copy link
Member

JelleZijlstra commented May 8, 2025

This is fixed on typing-extensions main. We will do a new release somewhat soon, but there's at least one other new feature I'd like to go in.

@pekkaklarck
Copy link
Author

No hurry for us. This caused some tests to fail, but those tests can use typing.TypedDict instead. Most likely the typing_extension usage was from time we supported Python 3.7.

pekkaklarck added a commit to robotframework/robotframework that referenced this issue May 8, 2025
No need to use typing_extensions.TypedDict in these tests when
typing.TypedDict works just fine. That avoids problems with
Python 3.14 (#5352) caused by a bug in typing_extensions:
python/typing_extensions#593
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants