-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Feat/watchpoints #13248
base: main
Are you sure you want to change the base?
Feat/watchpoints #13248
Conversation
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
_Identifier: TypeAlias = str | ||
|
||
class Watch: | ||
custom_printer: Callable[[Any], None] | None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several callback types this package have Any
as argument type(s), which are assigned with user-defined callbacks. I avoided using object
here to be compatible with user-defined callbacks, which may annotate the parameters with more precise types.
- Printer callbacks: accepts any object and writes to a stream
- Compare (
cmp
) callbacks: Accepts any 2 objects and compare their equality copy
: Makes a copy of any objectwhen
callbacks: Inspect/trace/watch an objectwhen
a condition is fulfilled; takes any object and outputs abool
.
This is a complete set of stubs for the watchpoints package (GitHub: https://github.com/gaogaotiantian/watchpoints).
Even though it seems like activity is low, it still gets ~800 downloads a week, and its lowish numbers are due to it being a debugging tool rather than a dependency library.
Its stated Python support ranges (3.6-3.10) are modest - I've run the tests locally on Python 3.13-dev and they pass without any modifications.
The intended API and types were inferred through the implementation and the README.