gh-91052: Add C API for watching dictionaries by carljm · Pull Request #31787 · python/cpython
Notes on the PR for reviewers:
- Since this API is intended for use by extensions, and
_Py*APIs are internal-only, I added the API as public (Py*). But I think it should perhaps be CPython-specific, so I put it inInclude/cpython/dictobject.h, notInclude/dictobject.h. Not sure about any of this, though, so happy to change as requested.
Do you have a test harness/or something I can use (without too much effort :)? I could just run the Python test suite but that may be missing the point.
Do you have a test harness/or something I can use (without too much effort :)? I could just run the Python test suite but that may be missing the point.
Hi! I'm not sure what you are trying to achieve -- can you clarify your goals and how they relate to this PR?
carljm
changed the title
bpo-46896: Add C API for watching dictionaries
gh-91052: Add C API for watching dictionaries
@markshannon I've updated this PR to the design we discussed, would be glad for your review. I'll try to get some updated pyperformance numbers tomorrow.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good. A few comments.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more comments, but looking good.
| self.assertIs(unraisable.object, d) | ||
| self.assertEqual(str(unraisable.exc_value), "boom!") | ||
|
|
||
| def test_two_watchers(self): |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is ref leaking on my PR: #98001
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah probably fixed in #98017 ?