Skip to content
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

TypedDict alternative definition syntax with keyword args is confusing #981

Closed
97littleleaf11 opened this issue Dec 17, 2021 · 0 comments · Fixed by python/cpython#31126
Closed
Labels
topic: other Other topics not covered

Comments

@97littleleaf11
Copy link

Originally opened in https://bugs.python.org/issue46066.
Related discussion: python/mypy#2492

According to the documentation, there are two additional equivalent syntax for TypedDict definition:

Point2D = TypedDict('Point2D', x=int, y=int, label=str)
Point2D = TypedDict('Point2D', {'x': int, 'y': int, 'label': str})

However, the former one is quite confusing since we have the total keyword arg for TypedDict. In addition, PEP589 doesn't have this syntax.

I think we could just deprecated it and remove it from the doc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: other Other topics not covered
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant