-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
TYPING: check-untyped-defs for util._decorators #28128
Conversation
@@ -90,9 +104,9 @@ def wrapper(*args, **kwargs): | |||
def deprecate_kwarg( | |||
old_arg_name: str, | |||
new_arg_name: Optional[str], | |||
mapping: Optional[Union[Dict, Callable[[Any], Any]]] = None, | |||
mapping: Optional[Union[Dict[Any, Any], Callable[[Any], Any]]] = None, |
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 think OK just to do Dict
instead of Dict[Any, Any]
; same thing but more readable
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 is the same thing but would fail --disallow-any-generics check.
although readability is important, i don't think the benefits of precise type checking can be understated.
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.
lgtm. Merge in a day or two if no other feedback
This should also close #27404 - updated OP to reflect that |
Thanks @simonjayhawkins |
xref Enable --check-untyped-defs for MyPy #27568
also fixes following errors arising from more precise typing...