-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
3.14: add annotationlib, update typing and inspect #13985
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
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly good, but could you comment the bare Any
s? I don't think we need documentation for dict[str, Any]
or the globals/locals, though.
@@ -27,6 +27,7 @@ def run_stubtest(typeshed_dir: Path) -> int: | |||
"-m", | |||
"mypy.stubtest", | |||
"--check-typeshed", | |||
"--show-traceback", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this is a testing remnant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was for testing but it seemed harmless to keep in.
This comment has been minimized.
This comment has been minimized.
I'm thinking of adding an alias |
Sounds like a good idea. I'm a fan of this kind of alias for |
Done. Also ended up making some more changes:
|
Diff from mypy_primer, showing the effect of this PR on open source code: ibis (https://github.com/ibis-project/ibis)
+ ibis/expr/operations/udf.py:143: error: Dict entry 0 has incompatible type "str": "Int64"; expected "str": "Argument" [dict-item]
artigraph (https://github.com/artigraph/artigraph)
+ src/arti/types/python.py:145: error: Non-overlapping identity check (left operand type: "ParamSpec", right operand type: "<typing special form>") [comparison-overlap]
+ src/arti/types/python.py:167: error: Non-overlapping identity check (left operand type: "ParamSpec", right operand type: "<typing special form>") [comparison-overlap]
hydra-zen (https://github.com/mit-ll-responsible-ai/hydra-zen)
+ src/hydra_zen/_utils/coerce.py:111: error: Need type annotation for "list_caster_by_pos" (hint: "list_caster_by_pos: dict[<type>, <type>] = ...") [var-annotated]
+ src/hydra_zen/_utils/coerce.py:112: error: Need type annotation for "list_caster_by_name" (hint: "list_caster_by_name: dict[<type>, <type>] = ...") [var-annotated]
+ src/hydra_zen/_utils/coerce.py:149: error: Incompatible types in assignment (expression has type "type", variable has type "ParamSpec") [assignment]
koda-validate (https://github.com/keithasaurus/koda-validate)
+ koda_validate/typehints.py:141: error: Non-overlapping identity check (left operand type: "ParamSpec", right operand type: "type[Just[A]]") [comparison-overlap]
|
Oops I merged the moment the mypy-primer diff came in. Might revert a few bits to get rid of those. |
The primer hits are a bit suspect. They all seem related to |
Yes it seems to pick the wrong overload of get_origin(). I tried to minimize this but haven't been able to. I'll revert that part of the PR for now. |
)" This reverts commit 5ff32f3.
)" This reverts commit 5ff32f3.
No description provided.