Repository navigation
Align text and bytes argument and buffer controls - #9698
Conversation
Share affix validation and buffer access while preserving translation callbacks, duplicate mappings, and bytes conversion identities. Assisted-by: OpenAI Codex:model version not exposed
|
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. |
Use the shared lossless concatenation helper so the qualified-name migration composes without restoring Rust Display formatting. Assisted-by: OpenAI Codex:model version not exposed
Merging this PR will not alter performance
Comparing Footnotes
|
Preserve both buffer and bytes-or-string argument imports while integrating the upstream hex separator conversion. Assisted-by: OpenAI Codex:model version not exposed
Extract the CPython-style deletion table and application into one pure helper used by bytes.translate and bytearray's existing slice helper. Keep acquisition, release ordering, allocation policy, and bytes identity handling in their existing callers. Preserve the direct zero/single-byte delete loop instead of paying for another table in those cases. Assisted-by: OpenAI Codex:model version not exposed
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
Group related CPython 3.15 text/bytes controls in 357 substantive changed lines (+200/-157):
Four production Rust files only. No Python, Lib, test, expected-failure marker or workflow changes. Partition/rpartition remain unchanged: pinned CPython intentionally retains the supplied separator object.
Reference and validation
Compared with CPython commit d220409a13b77de7a6c30abe16ea90db01528edc: bytes implementation, bytes helpers, and Unicode implementation.
50,330 bounded CPython/source-model assertions and 12,028 independent assertions passed. Coverage includes Unicode/surrogate bounds, tuple item validation, repeated mappings, bytes/bytearray consumers, exact/subclass identities and PEP 688 buffer acquisition/release callbacks with mutation and error paths. These are reference/model checks, not Rust implementation execution.
Independent exact-source review passed, including the final two lazy-default Clippy corrections. Bytearray #9694 composition passed git apply --check. Final focused host-env/VM/stdlib threading cargo check, normal all-targets Clippy and ordinary commit hooks passed. Clippy emitted exactly four unchanged main-baseline diagnostics: one POSIX needless-collect and three ElementTree lints. Strict -D warnings remains blocked by that baseline; no warnings were suppressed.
Native RustPython execution was not performed because the required execution guard has not been verified. Full workspace/C-API suites and cross-platform runtime validation remain unrun. Hosted CI is required; no expected failure is claimed resolved without runtime evidence.
Remaining limits
The existing qualified-type-name formatter does not preserve surrogate-containing type metadata. Generic binder diagnostics and pre-existing bytearray translation/export behavior outside these shared changes remain unchanged. Older architecture/GC/fallible-allocation PRs overlap some files and may need later textual reconciliation; no duplicate behavior fix was found in the 210-PR overlap audit.
AI-assisted contribution by OpenAI Codex, disclosed in the commit trailer.
Shared type-name compatibility
The bytes constructor diagnostic uses the existing WTF-8 concatenation helper so it remains lossless when composed with #9700. Other text/bytes control-flow changes are byte-identical to the previously reviewed head. Independent in-memory composition review verified the exact previous head plus this narrow formatting change. Final focused host-env/VM/stdlib threading check, normal all-targets Clippy and ordinary hooks passed; the same four unchanged baseline diagnostics remain. No new runtime execution or test changes are claimed.