-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Older stubs still explicitly using Any
rather than Incomplete
#9550
Comments
Do you think it's fine doing a single PR for those (single search & replace change across many third party stubs) instead of 40-70 PRs? Still gotta validate that those with few |
Maybe we could start off doing a grep for (or using a script to auto-update) function signatures with |
I'd say fairly safe, with only few false positives, are:
It's also not a complete disaster if a wrong |
Similar to |
class Foo:
a: Any
b: Any
c: Any We could find those using regexes or AST. |
Seems fine to me after running those we deem "safer".
+1 What Alex said. After
After a series of "autofixes". I can update the table above to see if there's still any obvious ones. |
It might actually be fine to change every Any in old stubs to Incomplete. In theory, we'll go over the Incompletes later and change them back to Any if appropriate. |
The only thing I'm a bit uneasy about is changing |
@srittau TypeAliases should probably also be left untouched if I"m to guess. |
Fancy taking this on as "stage 2", @Avasam? (Regardless of how far we want to go, I think I'd prefer to keep doing this in stages, so we can evaluate the risk level for each stage independently.) |
plus we may learn things so the same can be done for stdlib |
Thanks to typeshed-stats (#9386), I was able to make the following list of stubs majorly using
Any
, indicating that they've likely not been switched over toIncomplete
yet.Ordered by ratio of "explicit
Any
/ explicitIncomplete
+ 1" parameters and variables.Excludes stubs marked as obsolete and ratio <= 1 rounded down.
Any
Incomplete
(updated as of 2023-11-02)
We can also list 3rd party stubs by how many module-level and class-level variables they have:
for d in stubs/*/; do echo "$d,$( grep -ERoi '(^| )[[:alnum:]]+?: Any$' $d | wc -l )"; done
(updated as of 2024-01-29)
The text was updated successfully, but these errors were encountered: