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
requests: explicitly support AuthBase for Session.auth
According to the documentation, the auth parameter should be an AuthBase
subclass[1]. In practice, the actual requirement seems to just be a
Callable[[Request], Request], and AuthBase implements that with the __call__
method. However, mypy isn't currently smart enough to infer that __call__
implies Callable[2]. In the interim (and perhaps also to add clearer errors),
explicitly support AuthBase.
Additionally, this adds typing of AuthBase.__call__, to match the
Callable[[Request], Request] declaration used elsewhere.
[1] http://docs.python-requests.org/en/master/user/advanced/#custom-authentication
[2] python/mypy#797
0 commit comments