-
-
Notifications
You must be signed in to change notification settings - Fork 949
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Use of asgiref typing #1217
Comments
I guess the first step here would be to replace the |
@Kludex if we can maybe split this into multiple part, I can help with it too. |
The problem is that I'm not 100% sure, but I think what makes the issue hard to solve is the That being said... I believe the approach would be:
|
I helped with type-annotating Uvicorn, and I'm happy to help here as well. I've already made some good progress, and I'm on step 3 now. I need to correct a few type errors, now that we're importing from the more specific asgiref types. Should have a PR up shortly. |
@br3ndonland Cool! I'll be happy to review it. Just take in consideration that the steps mentioned were also a way to minimize the diff and make the review process easier. 🙏 |
Totally. I know these refactorings can create large diffs. It can be a lot to review. 😫 I'm trying to keep my commits organized, so you can easily see the steps taken, and walk through commit-by-commit. We can also break it up into multiple PRs if needed. |
Perfect! Thanks @br3ndonland ! |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Checklist
Is your feature related to a problem? Please describe.
On
uvicorn
we started amypy
compliance goal since some time ago, and we're about to accomplish it. On this road, we decided to use asgiref typing to annotate ASGI related types.What I propose is that we do the same for
Starlette
.Describe the solution you would like.
Remove the
types.py
module, and annotate everything that is needed withasgiref.typing
types.There's no matching type to
Message
, as discussed on #1206 . So even if it would be more pleasant to our users, unfortunately it will be more troublesome to follow that path.Describe alternatives you considered
Use
Message
asUnion[ASGISendCallable, ASGIReceiveCallable]
and solve themypy
issues. It will be more pleasant to ours users.The text was updated successfully, but these errors were encountered: