Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce stricter types for H2StreamStateMachine #1297

Merged
merged 2 commits into from
Feb 10, 2025

Conversation

mhils
Copy link
Member

@mhils mhils commented Feb 7, 2025

This PR changes

    def process_input(self, input_: StreamInputs) -> Any:

to

    def process_input(self, input_: StreamInputs) -> list[Event]:

to make the state machine properly typed. This requires a bunch of casts in H2Stream, but this is good because it ensures we don't violate invariants in the future. It also fixes some inconsistencies (HeaderTuple -> Header) that were discovered in the process.

@mhils mhils merged commit 6901794 into python-hyper:master Feb 10, 2025
8 checks passed
@mhils mhils deleted the more-types branch February 10, 2025 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant