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

Clarify ast docs to use a less confusing example for ast.ParamSpec #127955

Merged
merged 1 commit into from
Dec 15, 2024

Conversation

diceroll123
Copy link
Contributor

@diceroll123 diceroll123 commented Dec 15, 2024

Fixes a syntactical typo. The syntax is valid and works fine at runtime, but I noticed that pyright was nitpicky about it.


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

Copy link

cpython-cla-bot bot commented Dec 15, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app bedevere-app bot added docs Documentation in the Doc dir skip news awaiting review labels Dec 15, 2024
@tomasr8
Copy link
Member

tomasr8 commented Dec 15, 2024

What is the pyright error? Since this is valid syntax, maybe it's something for pyright to fix instead?

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I agree this example is less confusing if the type alias definition passed as the string to ast.parse() is one that type checkers would accept if it were in user code

@AlexWaygood AlexWaygood changed the title Fix typo in ast docs: ParamSpec defaults Clarify ast docs to use a less confusing example for ast.ParamSpec Dec 15, 2024
@AlexWaygood AlexWaygood merged commit 7900a85 into python:main Dec 15, 2024
38 checks passed
@AlexWaygood AlexWaygood added needs backport to 3.12 bug and security fixes needs backport to 3.13 bugs and security fixes labels Dec 15, 2024
@miss-islington-app
Copy link

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

@miss-islington-app
Copy link

Thanks @diceroll123 for the PR, and @AlexWaygood for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry, @diceroll123 and @AlexWaygood, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 7900a85019457c14e8c6abac532846bc9f26760d 3.12

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 15, 2024
…ythonGH-127955)

Fix typo in ast docs: ParamSpec defaults
(cherry picked from commit 7900a85)

Co-authored-by: Steve C <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Dec 15, 2024

GH-127959 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Dec 15, 2024
@AlexWaygood
Copy link
Member

Oh, it's not relevant for 3.12 because ParamSpec defaults are new in 3.13

@AlexWaygood AlexWaygood removed the needs backport to 3.12 bug and security fixes label Dec 15, 2024
@AlexWaygood AlexWaygood removed their assignment Dec 15, 2024
AlexWaygood pushed a commit that referenced this pull request Dec 15, 2024
…mSpec` (GH-127955) (#127959)

Clarify ast docs to use a less confusing example for `ast.ParamSpec` (GH-127955)

Fix typo in ast docs: ParamSpec defaults
(cherry picked from commit 7900a85)

Co-authored-by: Steve C <[email protected]>
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Jan 8, 2025
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
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants