FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-105895: Add `match` and `case` to `help` topics by dzherb · Pull Request #132784 · python/cpython · GitHub

Repository navigation

gh-105895: Add match and case to help topics - #132784

Closed
dzherb wants to merge 9 commits into
python:mainfrom
dzherb:gh-132783-match-help
Closed

dzherb wants to merge 9 commits into
python:mainfrom
dzherb:gh-132783-match-help

Conversation

dzherb commented Apr 21, 2025 •
edited
Loading

Copy link
Copy Markdown
Contributor

dzherb requested review from AA-Turner and hugovk as code owners April 21, 2025 18:33

python-cla-bot Bot commented Apr 21, 2025 •
edited
Loading

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

bedevere-app Bot commented Apr 21, 2025

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

dzherb commented Apr 21, 2025

Copy link
Copy Markdown
Contributor Author

I'm not sure if I should also commit the autogenerated topics.py

dzherb commented Apr 21, 2025 •
edited
Loading

Copy link
Copy Markdown
Contributor Author

This test case fails not due to unsorted keywords, but because match and case are not present in keyword.kwlist. Instead, they are listed in keyword.softkwlist, along with entries like type and _.

class TestHelper(unittest.TestCase):
    def test_keywords(self):
        self.assertEqual(sorted(pydoc.Helper.keywords),
                         sorted(keyword.kwlist))

I suggest splitting this into two separate cases:

class TestHelper(unittest.TestCase):
    def test_keywords_are_sorted(self):
        self.assertEqual(
            sorted(pydoc.Helper.keywords),
            list(pydoc.Helper.keywords),
        )

    def test_keywords_in_grammar(self):
        all_keywords = set(keyword.kwlist) | set(keyword.softkwlist)
        for kw in pydoc.Helper.keywords:
            self.assertIn(kw, all_keywords)

bedevere-app Bot commented May 5, 2025

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

sobolevn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I checked out this PR and tried:

I think that you need to regen pydoc-topics with: make -C Doc pydoc-topics

It might take a while.

Also, add a NEWS entry (see #132784 (comment) about how to do that) and change the issue number :) I will update you PR title for you to match the original issue #132783

sobolevn changed the title gh-132783: Add match and case to help topics gh-105895: Add match and case to help topics May 6, 2025

bedevere-app Bot commented May 6, 2025

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

Comment thread Lib/pydoc.py Outdated
dzherb requested a review from sobolevn May 7, 2025 11:57

dzherb commented May 9, 2025

Copy link
Copy Markdown
Contributor Author

@sobolevn could you please look at the last changes? Is everything ok?

sobolevn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM, but I can't merge this PR. Since I am not an expert in pydoc and I need someone who knows how it actually works to verify :)

StanFromIreland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

There are conflicts that need to be fixed.

Comment thread Lib/pydoc_data/topics.py

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please revert changes to this file, they will be automatically done before a release.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please move to "Library"

hugovk removed their request for review April 6, 2026 12:45

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

github-actions Bot added the stale Stale PR or inactive for long period of time. label May 14, 2026

Copy link
Copy Markdown
Member

Closing, changes haven't been made.

Copy link
Copy Markdown
Member

I will take this over and credit @dzherb for their work :)

sobolevn added a commit to sobolevn/cpython that referenced this pull request Jun 24, 2026
Originally published in python#132784

Co-authored-by: dzherb <zherbin.dima@yandex.ru>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review stale Stale PR or inactive for long period of time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL