Repository navigation
Align descriptor initialization and abstract controls with Python 3.15 - #9707
Conversation
|
Caution Review failedThe pull request is closed.
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. |
|
|
||
| impl PyObject { | ||
| /// Return the truth value of an optional abstract-method marker. | ||
| pub(crate) fn is_abstract(&self, vm: &VirtualMachine) -> PyResult<bool> { |
There was a problem hiding this comment.
is this correct implementation? isn't there a flag in CPython?
There was a problem hiding this comment.
Yes, this matches CPython’s _PyObject_IsAbstract(): it reads the optional __isabstractmethod__ attribute and applies PyObject_IsTrue(). A missing attribute returns false; lookup and truth-conversion errors propagate. classmethod, staticmethod, and _abc use that helper for the wrapped callable or class member.
Py_TPFLAGS_IS_ABSTRACT is a separate class-level flag, updated from __abstractmethods__ and used to prevent instantiating abstract classes. It does not represent an arbitrary object’s abstract-method marker, so it cannot replace the attribute lookup here.
Reference: CPython object.c (_PyObject_IsAbstract).
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
__new__, preserve identity no-ops, and reload the callable after replacement finalizers reenter initialization._abc; descriptor abstract markers are read-only.This Python 3.15 compatibility group changes five Rust files (+125/-170). It is independent of #9453's native staticmethod metadata path; its constructor/metadata additions must be preserved when composing. Broad GC ownership work may require integration care around the existing property name lock-release helper.
Validation
funcobject.c,descrobject.c,object.c, and_abc.c).Native RustPython runtime execution was not performed because its required safety guard is not verified. No repository tests, markers, or workflow files were changed. Hosted CI remains required.