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

Docs: Add restart_events() and positional arg semantics for sys.monitoring #111291

Merged
merged 2 commits into from
Oct 25, 2023

Conversation

gaogaotiantian
Copy link
Member

@gaogaotiantian gaogaotiantian commented Oct 24, 2023

All the functions in sys.monitoring are postional argument only, so use positional arg semantics to clarify it. Many functions like exec are already using it for the docs.

Also restart_events() is not mentioned in the docs, added it.


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

@gaogaotiantian
Copy link
Member Author

@AlexWaygood could you take a look at this as you just reviewed #111286? Thanks!

Comment on lines 287 to 291
.. function:: restart_events()

Enable all the events that were disabled by :data:`sys.monitoring.DISABLE`
for all tools.

Copy link
Member

Choose a reason for hiding this comment

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

oh no, I'll have to update the comment at https://github.com/python/typeshed/blob/5c775a3502af9264c74c69ebc1841a95b0147e04/stdlib/sys/_monitoring.pyi#L47 😆

In all seriousness, was this just an omission from the original PR that added documentation for sys.monitoring? You know more than me -- I was wondering whether it was maybe meant to be an undocumented implementation detail?

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe @markshannon just forgot to add this. DISABLE and MISSING were not in the initial docs either. I added them in when I polished the docs. The function is mentioned in PEP 669 and it's just like other functions.

Feature wise, we should have a public function to reset the disables from the users - or it would be kind confusing.

Doc/library/sys.monitoring.rst Outdated Show resolved Hide resolved
Doc/library/sys.monitoring.rst Outdated Show resolved Hide resolved
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
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.

LGTM. Thanks!

@AlexWaygood AlexWaygood added the needs backport to 3.12 bug and security fixes label Oct 25, 2023
@AlexWaygood AlexWaygood enabled auto-merge (squash) October 25, 2023 17:58
@AlexWaygood AlexWaygood merged commit 3f84a19 into python:main Oct 25, 2023
20 checks passed
@miss-islington-app
Copy link

Thanks @gaogaotiantian 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 25, 2023
…nitoring` (pythonGH-111291)

(cherry picked from commit 3f84a19)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Oct 25, 2023

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

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Oct 25, 2023
@gaogaotiantian gaogaotiantian deleted the sys-monitoring-docs branch October 25, 2023 18:09
AlexWaygood added a commit that referenced this pull request Oct 25, 2023
…`sys.monitoring` (GH-111291) (#111335)

Docs: Add `restart_events()` and positional arg semantics for `sys.monitoring` (GH-111291)
(cherry picked from commit 3f84a19)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
…nitoring` (python#111291)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
…nitoring` (python#111291)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
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.

2 participants