Skip to content

Conversation

@guoci
Copy link
Contributor

@guoci guoci commented Jan 4, 2026

docs: https://docs.python.org/dev/library/sys.monitoring.html#sys.monitoring.set_local_events
src: https://github.com/python/cpython/blob/c99f7667436d8978b4077704333e2a351f2a026f/Python/clinic/instrumentation.c.h#L295

https://github.com/python/cpython/blob/c99f7667436d8978b4077704333e2a351f2a026f/Python/instrumentation.c#L2431

>>> import sys
>>> TEST_TOOL = 2
>>> sys.monitoring.use_tool_id(TEST_TOOL, "MonitoringTest.Tool")
>>> def f():
...     a = 1
... 
>>> E = sys.monitoring.events
>>> sys.monitoring.set_local_events(TEST_TOOL, f.__code__, E.LINE)
>>> 

@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2026

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@srittau srittau merged commit 6b01bd4 into python:main Jan 6, 2026
63 checks passed
@guoci guoci deleted the patch-5 branch January 6, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants