-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Stubs for requests are too restrictive #1093
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
Comments
At the same time they are incomplete, some submodules (e.g. |
There's also an issue using
This is true enough, but (Aside: the reason code names are not actually defined is that in some cases there are a few aliases, and presumably the authors preferred to list aliases once in a 'lookup dict' than to |
Is this a limited set of attributes? Because then we can just add them all to the stub. |
Yes, but it is quite big. (A laborious rather than complex task.) Here's an excerpt: Edit: Or not an excerpt then - apparently code previews don't work across repos. |
So write a one-off script that prints the stuff you have to paste into the
stub. Alternatively, you can add a `__getattr__` that returns `Any`.
…On Sat, Nov 25, 2017 at 8:18 AM, Ollie Ford ***@***.***> wrote:
Yes, but it is quite big. (A laborious rather than complex task.) Here's
an excerpt:
https://github.com/requests/requests/blob/19919b44c4af95f125704c902acecd
f83d70a3e4/requests/status_codes.py#L54-L61
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1093 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACwrMraZEpxBMBFVhsXJTqmafJtyfp66ks5s6D3hgaJpZM4Mo6yY>
.
--
--Guido van Rossum (python.org/~guido)
|
This issue is pretty stale; several improvements have been made to requests' stubs and it's used enough that most egregious false positives are probably fixed. |
The 3rd party requests library is too dynamic for static typing, and its maintainers don't care about static typing. (There was previous discussion about this; can someone look up the issue?)
We still have stubs to guide users away from the most egregious issues, but the stubs are too restrictive. Maybe we should be satisfied with all methods and functions being
(*args: Any, **kwds: Any) -> Any
?The text was updated successfully, but these errors were encountered: