diff options
author | Itamar Ostricher <itamarost@gmail.com> | 2022-12-14 19:14:16 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-14 19:14:16 (GMT) |
commit | ae83c782155ffe86830c3255e338f366e331ad30 (patch) | |
tree | 353db1dc5287520c07b951467461deb8a10a84c4 /Modules/_testcapi | |
parent | aa8591e9ca9a3e55e96a03c17fa9d3902f0674dc (diff) | |
download | cpython-ae83c782155ffe86830c3255e338f366e331ad30.zip cpython-ae83c782155ffe86830c3255e338f366e331ad30.tar.gz cpython-ae83c782155ffe86830c3255e338f366e331ad30.tar.bz2 |
GH-100000: Cleanup and polish various watchers code (GH-99998)
* Initialize `type_watchers` array to `NULL`s
* Optimize code watchers notification
* Optimize func watchers notification
Diffstat (limited to 'Modules/_testcapi')
-rw-r--r-- | Modules/_testcapi/watchers.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/_testcapi/watchers.c b/Modules/_testcapi/watchers.c index 1d91c20..2e8fe1d 100644 --- a/Modules/_testcapi/watchers.c +++ b/Modules/_testcapi/watchers.c @@ -630,14 +630,16 @@ static PyMethodDef test_methods[] = { {"clear_dict_watcher", clear_dict_watcher, METH_O, NULL}, {"watch_dict", watch_dict, METH_VARARGS, NULL}, {"unwatch_dict", unwatch_dict, METH_VARARGS, NULL}, - {"get_dict_watcher_events", get_dict_watcher_events, METH_NOARGS, NULL}, + {"get_dict_watcher_events", + (PyCFunction) get_dict_watcher_events, METH_NOARGS, NULL}, // Type watchers. {"add_type_watcher", add_type_watcher, METH_O, NULL}, {"clear_type_watcher", clear_type_watcher, METH_O, NULL}, {"watch_type", watch_type, METH_VARARGS, NULL}, {"unwatch_type", unwatch_type, METH_VARARGS, NULL}, - {"get_type_modified_events", get_type_modified_events, METH_NOARGS, NULL}, + {"get_type_modified_events", + (PyCFunction) get_type_modified_events, METH_NOARGS, NULL}, // Code object watchers. {"add_code_watcher", add_code_watcher, METH_O, NULL}, |