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

Improve code examples in typing.rst #105346

Merged
merged 4 commits into from
Jun 7, 2023

Conversation

AlexWaygood
Copy link
Member

@AlexWaygood AlexWaygood commented Jun 6, 2023

  • Fix several SyntaxErrors and NameErrors in code examples. Add .. testcode:: directives to make sure they don't regress.
  • Add .. doctest:: directives to all REPL examples that pass, to make sure they continue to pass in the future.
  • Convert one or two examples to use PEP-695 syntax.
  • Add .. testcode:: directives to the code examples for get_args and get_origin, so the assertions we already have in those examples are tested in CI.
  • Use assertions in the code examples for get_type_hints and is_typeddict, and test these assertions using the .. testcode:: directive.

📚 Documentation preview 📚: https://cpython-previews--105346.org.readthedocs.build/

Doc/library/typing.rst Outdated Show resolved Hide resolved
@AlexWaygood AlexWaygood added needs backport to 3.11 only security fixes needs backport to 3.12 bug and security fixes labels Jun 6, 2023
@AlexWaygood
Copy link
Member Author

AlexWaygood commented Jun 6, 2023

@miss-islington
Copy link
Contributor

Thanks @AlexWaygood for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@AlexWaygood AlexWaygood deleted the typing-docs-syntax-errors branch June 7, 2023 06:47
@miss-islington
Copy link
Contributor

Sorry, @AlexWaygood, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 81c81328a4fa13fead6f8cc9053a1a32a62a0279 3.11

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 7, 2023
(cherry picked from commit 81c8132)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@bedevere-bot
Copy link

GH-105422 is a backport of this pull request to the 3.12 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.12 bug and security fixes label Jun 7, 2023
AlexWaygood added a commit that referenced this pull request Jun 7, 2023
Improve code examples in `typing.rst` (GH-105346)
(cherry picked from commit 81c8132)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@bedevere-bot
Copy link

GH-105427 is a backport of this pull request to the 3.11 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Jun 7, 2023
AlexWaygood added a commit to AlexWaygood/cpython that referenced this pull request Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip issue skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants