Repository navigation
feat: reuse weak callable proxy - #8618
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe VM adds ChangesCallable weak proxy support
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The PR adds callable weak-reference proxies while preserving the existing weak-reference lifecycle and call dispatch behavior. No actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant WeakrefAPI
participant PyWeakProxy
participant TypeZoo
participant Referent
WeakrefAPI->>PyWeakProxy: create weak proxy for Referent
PyWeakProxy->>Referent: check callable status
PyWeakProxy->>TypeZoo: select weakcallableproxy_type
PyWeakProxy-->>WeakrefAPI: return PyWeakCallableProxy
WeakrefAPI->>PyWeakProxy: invoke proxy
PyWeakProxy->>Referent: upgrade and forward call
Referent-->>WeakrefAPI: return result
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [ ] lib: cpython/Lib/concurrent dependencies:
dependent tests: (17 tests)
[x] test: cpython/Lib/test/test_descr.py (TODO: 31) dependencies: dependent tests: (no tests depend on descr) [ ] test: cpython/Lib/test/test_class.py (TODO: 13) dependencies: dependent tests: (no tests depend on class) [x] test: cpython/Lib/test/test_cmd_line_script.py (TODO: 14) dependencies: dependent tests: (no tests depend on cmd_line_script) [ ] test: cpython/Lib/test/test_import (TODO: 3) dependencies: dependent tests: (no tests depend on import) [x] lib: cpython/Lib/weakref.py dependencies:
dependent tests: (224 tests)
Legend:
|
One of checkbox below must be checked.
Summary
Adds the missing
weakcallableproxytype, so a proxy to a callable referent is itself callable, matching CPython's_PyWeakref_CallableProxyType.weakref.CallableProxyTypewas only an alias forweakproxy, soweakref.proxy(callable_obj)()raisedTypeError: 'weakproxy' object is not callable, andweakref.ProxyTypesheld the same type twice.PyWeakCallableProxyis a newtype overPyWeakProxywithbase = PyWeakProxy: it inherits every proxy slot and only addsCallable, which forwards to the referent and raisesReferenceErroronce it is gone (as CPython'sproxy_call)Summary by CodeRabbit