-
-
Notifications
You must be signed in to change notification settings - Fork 856
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
Switch to explicit typing.Optional
throughout
#2096
Switch to explicit typing.Optional
throughout
#2096
Conversation
Thanks @michaeloliverx This seems right to me. But it also looks like this would belong to a wider "do we want to comply with Edit: see #1747 |
Happy to read @tomchristie's viewpoint on this -- should we start a discussion on |
Thanks @michaeloliverx, @florimondmanca.
Interesting, right? It's a little bit niggly that typing in Python ends up having this effect. We've got correct and consistent typing throughout, that helps us have confidence in changes within our codebase. But if our users choose to run I'd suggest that we value consistency above one-off fixes. So... we ought to consider a PR that switches to explicit
This is a good point. A smart first pass at this would be a pull request that just turns on strict mode for our type checking. That'll fail, but it'd give us the complete set of changes that we'd need to make if we wanted to change this. |
Currently
Enabling this may generate a lot of noise unrelated to using explicit
We could enable |
--strict
and AsyncExitStack
typing.Optional
throughout
Okay I have now enabled
I think these issues are actually with |
Those some like mostly internal issues, right? Can we just |
Yes we could do that for now. |
Okay this is ready now, I have ignored internal type errors for now. |
I opened a similar PR at encode/httpcore#513. If that is approved then we could remove the type ignore comments. |
Now that encode/httpcore#513 has been merged I think we should wait until |
@michaeloliverx |
running your branch and updating httpcore: (venv) vfazio@vfazio2 /tmp/tmp.OcS7trgNiz $ git diff
diff --git a/setup.py b/setup.py
index 0ca769f..f6edfdd 100644
--- a/setup.py
+++ b/setup.py
@@ -60,7 +60,7 @@ setup(
"charset_normalizer",
"sniffio",
"rfc3986[idna2008]>=1.3,<2",
- "httpcore>=0.14.5,<0.15.0",
+ "httpcore>=0.15.0,<0.16.0",
],
extras_require={
"http2": "h2>=3,<5",
|
@vfazio thanks! |
This looks ready to me! |
Sure thing, let's do it. |
Fixes #2092