typing: unable to override `pool_classes_by_scheme` with a `partial`d class · Issue #3554 · urllib3/urllib3 · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this ~slightly reduces type safety in that a call to the value of this will no longer have its arguments checked agains the shape of HTTPConnection -- but it does allow more flexibility for what values can be in the dictionary (while still preserving the return value shape)
I'll probably just # type: ignore for now though since that's the least friction
The text was updated successfully, but these errors were encountered:
Subject
incredibly specific unfortunately -- https://github.com/getsentry/sentry/blob/00f7a931ef9cb9efc31658a89d85eed19a52155e/src/sentry/net/http.py#L138-L141
we have to patch all the way down to do ip address filtering in requests / urllib3 -- to override the connection creation mechanism
as a result we override pool classes and it appears the typing for this is a little too strict (
dict[str, type[HTTPConnectionPool]]
)Environment
Describe your environment.
At least, paste here the output of:
Steps to Reproduce
I don't have a good minimal reproduction but the error from mypy is as follows:
Expected Behavior
ideally no errors
Actual Behavior
see above
an aside -- if I adjust the annotation slightly I can get this to pass:
this ~slightly reduces type safety in that a call to the value of this will no longer have its arguments checked agains the shape of
HTTPConnection
-- but it does allow more flexibility for what values can be in the dictionary (while still preserving the return value shape)I'll probably just
# type: ignore
for now though since that's the least frictionThe text was updated successfully, but these errors were encountered: