Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Make a top-level TypedDict page#14584

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
hauntsaninja merged 1 commit intopython:masterfromhauntsaninja:docs5
Feb 2, 2023

Conversation

@hauntsaninja
Copy link
Collaborator

@hauntsaninjahauntsaninja commentedFeb 2, 2023
edited
Loading

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.TypedDict has been the target for several features, including some thatare not yet documented. There was another PEP drafted today that wasTypedDict themed. It's also pretty popular with users.
@tmke8
Copy link
Contributor

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).

AlexWaygood, gandhis1, 97littleleaf11, and JukkaL reacted with thumbs up emoji

Copy link
Member

@JelleZijlstraJelleZijlstra left a 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 usetyping_extensions imports in the docs? TypedDict has been in the stdlib since 3.8.

AlexWaygood reacted with thumbs up emoji
@hauntsaninjahauntsaninja merged commit3f13939 intopython:masterFeb 2, 2023
@hauntsaninjahauntsaninja deleted the docs5 branchFebruary 2, 2023 19:55
@hauntsaninja
Copy link
CollaboratorAuthor

hauntsaninja commentedFeb 2, 2023
edited
Loading

Thanks, will make actual edits in a separate PR.

Do we have a general stance on when to usetyping_extensions

I don't think we do. My views:

  • 3.7 is close enough to EOL that I don't mind having random snippets in examples assume 3.8. I'm doing a big docs editing pass now, I may as well save us some time in four months (we may still want to support 3.7 for a little longer, but we don't need to target our educational material at those users)
  • We should still havetyping_extensions documented in places that it's helpful, it just doesn't necessarily need to be every snippet
  • We should also improve the error message mypy gives when imports are missing fromtyping

@hauntsaninja
Copy link
CollaboratorAuthor

PR for the suggestion here:#14591

hauntsaninja added a commit that referenced this pull requestFeb 3, 2023
This just moves content around (with minimal editing to make the movesmake sense).TypedDict has been the target for several features, including some thatare not yet documented. There was another PEP drafted today that wasTypedDict themed. It's also pretty popular with users.Linking#13681
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@JelleZijlstraJelleZijlstraJelleZijlstra approved these changes

@JukkaLJukkaLJukkaL approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@hauntsaninja@tmke8@JelleZijlstra@JukkaL

[8]ページ先頭

©2009-2025 Movatter.jp