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

gh-133510: Add links to more info for the match statement#133511

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

Open
xzkdeng wants to merge7 commits intopython:main
base:main
Choose a base branch
Loading
fromxzkdeng:main

Conversation

xzkdeng
Copy link

@xzkdengxzkdeng commentedMay 6, 2025
edited by github-actionsbot
Loading

Add example of thematch statement in the FAQ "Why isn't there a switch or case statement in Python?", and links to PEP 634,PEP 636 for details.


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

Add example of the ``match`` statement in the FAQ "Why isn't there a switch or case statement in Python?", and links to PEP 634,PEP 636 for details.
@python-cla-bot
Copy link

python-cla-botbot commentedMay 6, 2025
edited
Loading

All commit authors signed the Contributor License Agreement.

CLA signed

@xzkdengxzkdeng changed the titlegh-133510: Add example for the match statementgh-133510: Add links to more info for the match statementMay 6, 2025
Since Python 3.10 one can easily match literal values, or constants
within a namespace, with a ``match ... case`` statement.
See :pep:`634` (specification) and :pep:`636` (tutorial) for details about the ``match`` statement.
Copy link
Contributor

Choose a reason for hiding this comment

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

For the "(tutorial)" it is probably best to replace the link with a link to theactual tutorial page that covers this.

Copy link
Member

Choose a reason for hiding this comment

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

Agreed. The PEPs are historical documents that typically become stale over time. I think that there shouldn't be a link to a PEP for either the specification or tutorial.

StanFromIreland and xzkdeng reacted with thumbs up emoji
Copy link
Author

Choose a reason for hiding this comment

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

So we should add an 'outdated' note in PEP 636, like the one in PEP 634.

Co-authored-by: sobolevn <mail@sobolevn.me>
Since Python 3.10 one can easily match literal values, or constants
within a namespace, with a ``match ... case`` statement.
See :pep:`634` (specification) and :pep:`636` (tutorial) for details about
Copy link
Member

Choose a reason for hiding this comment

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

Please link to the documentation too here.

Copy link
Author

Choose a reason for hiding this comment

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

Did you mean adding a link tothis?

@bedevere-app
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phraseI have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

xzkdengand others added2 commitsMay 9, 2025 18:51
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Changed the links to link to more up-to-date documentation.
@xzkdeng
Copy link
Author

I have made the requested changes; please review again
Suggestions are welcomed!

@bedevere-app
Copy link

Thanks for making the requested changes!

@AA-Turner: please review the changes made to this pull request.

@bedevere-appbedevere-appbot requested a review fromAA-TurnerMay 9, 2025 11:15
@xzkdengxzkdeng reopened thisMay 9, 2025
@xzkdeng
Copy link
Author

Accidentally clicked the "close with comment" button.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ericvsmithericvsmithericvsmith left review comments

@sobolevnsobolevnsobolevn left review comments

@StanFromIrelandStanFromIrelandStanFromIreland left review comments

@AA-TurnerAA-TurnerAwaiting requested review from AA-Turner

Assignees
No one assigned
Labels
awaiting change reviewdocsDocumentation in the Doc dirskip news
Projects
Status: Todo
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@xzkdeng@ericvsmith@sobolevn@AA-Turner@StanFromIreland

[8]ページ先頭

©2009-2025 Movatter.jp