Skip to content

Conversation

@schloerke
Copy link
Collaborator

@schloerke schloerke commented Jan 16, 2024

Related: Kludex/starlette#2381

Do not merge until motivation for #1009 is resolved

@schloerke schloerke requested a review from wch January 16, 2024 20:02
@schloerke schloerke added this to the v0.8.0 milestone Jan 19, 2024
@wch wch marked this pull request as ready for review March 2, 2024 05:38
@wch
Copy link
Collaborator

wch commented Mar 2, 2024

I think the root of this problem is:
starlette claims that you can use types from starlette or types from asgiref, where the latter are more rigorous (and what we have in the existing code). They show the two methods here:
https://github.com/encode/starlette/blob/39dccd9/docs/middleware.md#type-annotations

However, in Kludex/starlette#2381, the explicit types they added are the starlette types, not the asgiref types, and that's why we started getting type-checking errors.

The change in this PR makes it so, on the outside, it uses the starlette types, but on the inside, it uses the asgiref types.

I think it would be better if the external interface supported both types.

@wch wch merged commit f0a05fa into main Mar 2, 2024
@wch wch deleted the check_failures branch March 2, 2024 06:20
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.

3 participants