mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[BE]: Update mypy to 1.10.0 (#127717)
Updates mypy to the latest and greatest. Pull Request resolved: https://github.com/pytorch/pytorch/pull/127717 Approved by: https://github.com/ezyang
This commit is contained in:
committed by
PyTorch MergeBot
parent
fb53cd6497
commit
30213ab0a7
@ -85,10 +85,10 @@ librosa>=0.6.2 ; python_version < "3.11"
|
||||
#Pinned versions:
|
||||
#test that import:
|
||||
|
||||
mypy==1.9.0
|
||||
mypy==1.10.0
|
||||
# Pin MyPy version because new errors are likely to appear with each release
|
||||
#Description: linter
|
||||
#Pinned versions: 1.9.0
|
||||
#Pinned versions: 1.10.0
|
||||
#test that import: test_typing.py, test_type_hints.py
|
||||
|
||||
networkx==2.8.8
|
||||
|
@ -136,7 +136,7 @@ init_command = [
|
||||
'numpy==1.24.3 ; python_version == "3.8"',
|
||||
'numpy==1.26.0 ; python_version >= "3.9"',
|
||||
'expecttest==0.1.6',
|
||||
'mypy==1.9.0',
|
||||
'mypy==1.10.0',
|
||||
'sympy==1.11.1',
|
||||
'types-requests==2.27.25',
|
||||
'types-PyYAML==6.0.7',
|
||||
|
@ -44,7 +44,7 @@ class DefaultFuseHandler(FuseHandler):
|
||||
def __init__(
|
||||
self,
|
||||
node: Node):
|
||||
super().__init__(node)
|
||||
super().__init__(node) # type:ignore[safe-super]
|
||||
|
||||
def fuse(self,
|
||||
load_arg: Callable,
|
||||
|
@ -342,4 +342,8 @@ def register_fsdp_forward_method(module: nn.Module, method_name: str) -> None:
|
||||
return fsdp_state._post_forward(self, args, out)
|
||||
|
||||
# Use `__get__` to make `wrapped_method` an instance method
|
||||
setattr(module, method_name, wrapped_method.__get__(module, type(module)))
|
||||
setattr(
|
||||
module,
|
||||
method_name,
|
||||
wrapped_method.__get__(module, type(module)), # type:ignore[attr-defined]
|
||||
)
|
||||
|
@ -117,7 +117,7 @@ class lazy_property:
|
||||
|
||||
def __init__(self, wrapped):
|
||||
self.wrapped = wrapped
|
||||
update_wrapper(self, wrapped)
|
||||
update_wrapper(self, wrapped) # type:ignore[arg-type]
|
||||
|
||||
def __get__(self, instance, obj_type=None):
|
||||
if instance is None:
|
||||
|
@ -60,7 +60,7 @@ class AST_Rewriter(ast.NodeTransformer):
|
||||
closure=f.__closure__,
|
||||
)
|
||||
g = functools.update_wrapper(g, f)
|
||||
g.__kwdefaults__ = copy.copy(f.__kwdefaults__)
|
||||
g.__kwdefaults__ = copy.copy(f.__kwdefaults__) # type:ignore[attr-defined]
|
||||
return g
|
||||
# Return the correct FunctionType object
|
||||
return change_func_globals(fn_compiled, globals=fn.__globals__)
|
||||
|
Reference in New Issue
Block a user