Repository navigation
Share builtin standard-stream callback controls - #9720
Draft
youknowdot wants to merge 2 commits into
Draft
youknowdot wants to merge 2 commits into
youknowdot wants to merge 2 commits into
Conversation
Preserve print and input argument owners, stream selection, conversion order, audit hooks and writer callback cleanup through shared I/O helpers. Assisted-by: OpenAI Codex:model version not exposed
Avoid duplicate separator owners without moving controls out of their retained argument structure. Assisted-by: OpenAI Codex:model version not exposed
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
youknowone
reviewed
Nov 6, 2026
| // Missing means an empty prompt. | ||
| #[pyarg(positional, optional, py_default = "''")] | ||
| prompt: OptionalArg<PyStrRef>, | ||
| prompt: OptionalArg<PyObjectRef>, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Group CPython 3.15 print/input callback controls in 167 changed lines across two production Rust files.
Validation
Reference: CPython d220409a13b77de7a6c30abe16ea90db01528edc, Python/bltinmodule.c, its generated clinic binder, Objects/fileobject.c and Python/sysmodule.c.
The pinned CPython oracle passed 47 probes and 10 explicit assertions. Independent review reran it and added seven assertions across three callback/finalizer probes. These are reference/source checks, not execution of RustPython.
Independent exact-source review passed, including the final borrowed-option cleanup. Final threaded cargo check passed in 1m06s and all-targets Clippy in 2m21s, with all 12 unchanged baseline diagnostics matching exactly. No warnings were suppressed. Normal commit hooks, rustfmt and git diff --check passed.
No tests, Lib files, assertions, expected failures or workflows were changed. Native RustPython execution remains unrun because the required execution guard has not been verified. Full workspace/C-API suites, native differential tests and separate platform/feature graphs remain unrun; hosted CI is pending.
Scope and integration
The shared file writer performs one lookup per emitted piece, not a cached lookup for the whole print call. Selected streams and raw input/print owners remain alive across callbacks. Caller-wide argument and outer stream teardown beyond the retained lifetimes are not claimed fixed. Existing extremely long separator/end type-name diagnostics are not truncated to CPython's 200-byte limit.
Full CPython interactive readline, terminal encoding and fallback parity remain outside scope. The existing rustyline/PTY guard is retained, and no terminal runtime validation was performed. The independent vars exception-masking issue is not included.
Existing #9690 shutdown/unraisable handling, #9699 iterator controls and #9718 min/max streaming do not duplicate these behaviors. No general sys stream helper or shutdown behavior is changed. The shared readline diagnostic affects its existing callers without changing successful or EOF behavior.
AI-assisted contribution by OpenAI Codex; assistance is disclosed in the commit trailer.