Repository navigation
Define sched_param.__reduce__ with #[pymethod] - #9551
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. |
Merging this PR will not alter performance
Comparing Footnotes
|
f9ee4da to
43d2077
Compare
Assisted-by: OpenAI Codex:model version not exposed
Retain coverage of signature infrastructure while removing tests tied to individual Python callables, as requested. Assisted-by: OpenAI Codex:model version not exposed
Replace the derive expansion token comparison tests with a vm test that checks the class signature produced by constructor_args. Install the default struct sequence __reduce__ unconditionally; an impl's own __reduce__ method replaces it. Assisted-by: Claude
43d2077 to
880ae1a
Compare
Remove the constructor_args pystruct_sequence option, the PyStructSequence::CONSTRUCTOR_PARAMS constant, and their tests. The class signature of struct sequences again falls back to (iterable=(), /); sched_param keeps its #[pymethod] __reduce__. Assisted-by: Claude
Codex Review Summary: ❌ FailedThis 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
posix.sched_param.__reduce__with#[pymethod]instead of a hand-builtPyMethodDefinstalled in#[extend_class]. It now reports__text_signature__ == '($self, /)'with__doc__ is None, matching CPython's METH_NOARGS method without a docstring. The return value is unchanged:(type, (sched_priority,)).PyStructSequence::extend_classnow installs the default__reduce__unconditionally. Method definitions are installed after class extension, so an impl's own__reduce__replaces the default; thecontainscheck had no remaining users.Not in scope
The class signature of
sched_paramstill falls back to(iterable=(), /)(CPython:(sched_priority)). An earlier revision of this PR added aconstructor_argsoption to#[pystruct_sequence]for it; that option was removed becausesched_paramwould be its only user and the declared type was not tied to the typeslot_newbinds.Validation
cargo fmt --check,cargo clippy -p rustpython-vm --all-targets(no new warnings).time.struct_timepickle round-trip andos.stat_result.__reduce__signature/doc checked.sched_paramis Linux-only; relying on CI for it.🤖 Generated with Claude Code