Replies: 9 comments 2 replies
-
I guess the first step here would be to replace the |
Beta Was this translation helpful? Give feedback.
-
@Kludex if we can maybe split this into multiple part, I can help with it too. |
Beta Was this translation helpful? Give feedback.
-
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:
|
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
@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. 🙏 |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
Perfect! Thanks @br3ndonland ! |
Beta Was this translation helpful? Give feedback.
-
Hmmm... Converting this issue made a pretty ugly discussion page... I wish I could revert... Anyway, opinions about what's written here are welcome. @encode/maintainers |
Beta Was this translation helpful? Give feedback.
-
I'm sorry to see this discussion has lost momentum. I think there's value in making these changes, otherwise I have to add type ignores to any code that pairs up I just spent a couple of hours (not for the first time) trying to figure out where I was going wrong with making |
Beta Was this translation helpful? Give feedback.
-
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.Beta Was this translation helpful? Give feedback.
All reactions