Skip to content

Should we add runnable example for sys.monitoring? #125770

Closed
@xuantengh

Description

@xuantengh

Currently the sys.monitoring doc (https://docs.python.org/3/library/sys.monitoring.html) contains NO concrete example of how sys.monitoring APIs should be invoked in a workflow. Nor did I find any straightforward examples of sys.monitoring after some simple Googling.

Should we consider adding an runnable example like function coverage with sys.monitoring APIs?

Activity

xuantengh

xuantengh commented on Oct 21, 2024

@xuantengh
ContributorAuthor

E.g. https://mostlynerdless.de/blog/2023/11/10/lets-create-a-python-debugger-together-part-4-python-3-12-edition/?

IMHO this is still somehow complicated. I think the code snippet in #111963 may be a good example?

gaogaotiantian

gaogaotiantian commented on Oct 21, 2024

@gaogaotiantian
Member

I'm a bit on the fence. On one hand, it would be nice to have some example. However, this is an API that is almost exclusively for dev tool developers and I don't know how much examples would benefit, compared to the extra space it would take to make the docs less readable. As a comparison, sys.settrace and sys.setprofile does not have any examples in the docs (that I can find).

The reason why there aren't many examples on the internet is because the feature is only out about a year. Even stdlib has not fully adopted it yet.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Should we add runnable example for `sys.monitoring`? · Issue #125770 · python/cpython

      Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

      Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant