Rebuild on stdlib loop machinery: subclass BaseEventLoop, remove Tokio, require Python 3.11+ - #1
Merged
Conversation
…o, require Python 3.11+
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.
The loop now subclasses
base_events.BaseEventLoopand borrows the selector-loop method families it needs, so the previously transcribedcreate_connection/create_server/start_tls/subprocess bodies are inherited per-version instead of frozen at transcription time.SubprocessTransportis 20 lines overBaseSubprocessTransport, keeping only the executor spawn; transports adopt the stdlib_FlowControlMixinand gainBufferedProtocolsupport. The Tokio host is gone: the driver blocks directly in thepollingreactor with the GIL released, which removes the ~1ms timer-granularity penalty, and embedding runtimes wake the loop through its thread-safe scheduling path. Rust drops to three files (243 lines); Python to ~400.Crate API break (0.2.0):
TokioCoreandPyReactor::with_handleare removed. The Python surface is unchanged. Python floor rises to 3.11 (a 12-line shim covers the_run_forever_setuphelpers that first appear in 3.12); CI now tests 3.11 through 3.14 and ships wheels for the same. DEV.md documents the architecture, the borrowed surface, and local multi-version testing via uv.