Repository navigation
Align memoryview scalar, cast, and indexing controls - #9692
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
|
3e5d184 to
af5cc4e
Compare
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [x] lib: cpython/Lib/sqlite3 dependencies:
dependent tests: (2 tests)
Legend:
|
af5cc4e to
7700b57
Compare
Reuse the shared Clinic binder, numeric converters and struct cache while preserving memoryview-specific scalar policies. Avoid per-scalar temporary allocations and redundant object clones. Match cast, indexing, comparison and half conversion behavior, preserve callback lifetimes, and fix multidimensional comparison and shared-buffer reads. Add focused Rust and Python regression coverage. AI assistance covered implementation, test preparation and source review. Assisted-by: OpenAI Codex:model version not exposed
Keep retained owners outside lock scopes and preserve callback-sensitive release ordering. Assisted-by: OpenAI Codex:model version not exposed
7700b57 to
8451d4f
Compare
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
Align memoryview scalar formats, casts, indexing, assignment and comparison with CPython 3.15. Rebased onto main
22ee0b0380through #9563 (a5d24851a5e94c81770935e6578c6081fda10705), retaining its strict shared Clinic binding and string conversion.Reference: CPython 3.15 memoryobject.c, struct and float packing.
CI failure and rebase
The previous head failed the CPython suites on Linux, macOS and Windows only because two SQLite tests unexpectedly passed while still marked expectedFailure:
test_set_progress_handler_keyword_argsandtest_func_keyword_args. The inherited binder fixed their behavior; #9563 retires those two obsolete decorators. Memoryview and struct passed on all three OSes.The rebase preserves main's new staged CSV parser and list/tuple/slice behavior. Its shared unnamed duplicate-argument diagnostic now omits parentheses, matching CPython, without restoring parser opt-outs. Saturating index conversion is shared with the new sequence helper while preserving temporary argument lifetimes.
Validation
Verified locally on Linux x86_64 with CPython 3.15.0 as the reference:
stdlib,stdio,importlib,host_env,doc,threading,sqliteand no default features.-D warnings. All changed-file hooks and formatting checks passed.The release-after-index char assignment intentionally retains RustPython's safety check: when an index callback releases a
cast('c')view, assignment raises ValueError rather than writing through the released view as CPython currently does. Fresh hosted CI remains required. No claim of complete memoryview compatibility or a measured speedup is made.AI-assisted implementation, testing and source review using OpenAI Codex; model version is not exposed.