-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Make a top-level TypedDict page #14584
Conversation
This just moves content around. TypedDict has been the target for several features, including some that are not yet documented. There was another PEP drafted today that was TypedDict themed. It's also pretty popular with users.
Maybe the class-based syntax should be introduced before the functional syntax? It seems to me the class-based syntax is nowadays preferred. I only see the functional syntax recommended when a key is not a valid variable name (e.g., it contains a hyphen or it coincides with a reserved keyword). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the feedback that we should focus on the class-based syntax, and mention the functional syntax only as an alternative for rare cases. However, that might be better done in a separate PR, leaving this one focused on the move.
Other feedback:
- Consider using
:py:data:
to link to the stdlib docs, like we do for NewType. - Do we have a general stance on when to use
typing_extensions
imports in the docs? TypedDict has been in the stdlib since 3.8.
Thanks, will make actual edits in a separate PR.
I don't think we do. My views:
|
PR for the suggestion here: #14591 |
This just moves content around (with minimal editing to make the moves make sense). TypedDict has been the target for several features, including some that are not yet documented. There was another PEP drafted today that was TypedDict themed. It's also pretty popular with users. Linking #13681
This just moves content around (with minimal editing to make the moves make sense).
TypedDict has been the target for several features, including some that are not yet documented. There was another PEP drafted today that was TypedDict themed. It's also pretty popular with users.
Linking #13681