-
Notifications
You must be signed in to change notification settings - Fork 18
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
Type mismatch a2wsgi.asgi_typing.*Scope and starlette.types.Scope #44
Comments
Starlette removed some Any annotations in 0.34.0. Issue tracked in abersheeran/a2wsgi#44
It's neither Starlette nor a2wsgi's problem, it's because Python currently doesn't handle extra keyword arguments gracefully. You can use type: ignore to work around it. The reason a2wsgi has detailed type annotations is that a2wsgi is supposed to work between frameworks that conform to those specifications. Detailed type annotations help to check for compatibility issues. As for web frameworks, they may prefer the looser MutableMapping since users tend to pass many non-spec keys and values. |
Hey there, we're using a2wsgi and it helped us a lot, but with starlette 0.34.0 we've started seeing
I believe this is because a2wsgi uses
TypedDict
while starlette uses MutableMapping, which are not compatible. I'm not sure what the solution would be, maybe this is something I should raise at starlette, but it seems like one could in principle add arbitrary keys which would makeTypedDict
the wrong choice ?The text was updated successfully, but these errors were encountered: