This PR adds a Literal annotation for the different requests.Session methods we invoke in _request_wrapper. By declaring the methods we can possibly call, we get better type inference - which in turn removes the need for using typing.cast.
This approach is a little more verbose, but makes it much easier to reason with the code as well as improving type safety.
This PR adds a
Literal
annotation for the differentrequests.Session
methods we invoke in_request_wrapper
. By declaring the methods we can possibly call, we get better type inference - which in turn removes the need for usingtyping.cast
.This approach is a little more verbose, but makes it much easier to reason with the code as well as improving type safety.