Skip to content

Fix first parameter name in tool functions from sys.monitoring #111286

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

Merged
merged 2 commits into from
Oct 24, 2023

Conversation

lancelote
Copy link
Contributor

@lancelote lancelote commented Oct 24, 2023

Small typo fix, the first parameter of these functions from sys.monitoring (Python 3.12) has tool_id name instead of id

>>> sys.monitoring.get_tool.__text_signature__
'($module, tool_id, /)'

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

@bedevere-app bedevere-app bot added awaiting review docs Documentation in the Doc dir skip news labels Oct 24, 2023
@Eclips4
Copy link
Member

Eclips4 commented Oct 24, 2023

None of these functions doesn't take an keyword arguments, so, I'm doesn't sure that we should change it.

If we do decide change that, we should update the description of these functions (because old name of parameter is used there)

@gaogaotiantian
Copy link
Member

I'm in favor of changing it just because it matches the functions below so it'll probably be easier for users to understand. The signature is another reason - we did use tool_id in C code. It might be easier if we just call it tool_id all the time.

However, as @Eclips4 said, you need to change the function descriptions as well. The descriptions uses id to refer to the argument. The IDs at the end of the section are fine - they are more generic.

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.

Yeah, I'm with @gaogaotiantian here -- apart from anything else, it's pretty confusing when parameter names in the docs don't match the parameter names displayed by help() in the REPL at runtime. You were absolutely right that other mentions of *id* also needed to be updated though @Eclips4 -- thanks! I've pushed the necessary changes to @lancelote's branch; will schedule automerge :)

@AlexWaygood AlexWaygood enabled auto-merge (squash) October 24, 2023 21:12
@AlexWaygood AlexWaygood merged commit 8b44f3c into python:main Oct 24, 2023
@miss-islington-app
Copy link

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 24, 2023
@bedevere-app
Copy link

bedevere-app bot commented Oct 24, 2023

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

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Oct 24, 2023
AlexWaygood pushed a commit that referenced this pull request Oct 24, 2023
…ing` (GH-111286) (#111290)

Fix first parameter name in `tool` functions from `sys.monitoring` (GH-111286)
(cherry picked from commit 8b44f3c)

Co-authored-by: Pavel Karateev <[email protected]>
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
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