Closed benbariteau closed 2 years ago
That's a good point, but there is a stubs package (types-requests
) for it. I think fitting in with that might make sense.
Yeah. The types for requests-futures would basically be identical params and the return would change to be a future who's result is the original return type. The whole design of the package is fundamentally set up to preserve the API with the and wrap the return in a future. The types-requests module could be updated to include type info for futures pretty easily if someone wanted to do that.
The types-requests module could be updated to include type info for futures pretty easily if someone wanted to do that.
How would that work?
requests
itself doesn't currently use type annotations so i'm hesitant to try to do anything with them here. Beyond that if you look at the code the majority of the methods are just wrappers aroundrequests
methods that add on async handling. I can't really put types on parameters that don't exist:https://github.com/ross/requests-futures/blob/a0826c96b017b0bea3125259d451c7b858994d81/requests_futures/sessions.py#L126-L134
Closing for now. If at some point
requests
makes the changes this can be revisited.