@@ -82,9 +82,9 @@ def __init__(self, project, resource, offset):
8282
8383 def get_changes (
8484 self ,
85- dest_attr ,
86- new_name = None ,
87- resources = None ,
85+ dest_attr : str ,
86+ new_name : Optional [ str ] = None ,
87+ resources : Optional [ List [ resources . File ]] = None ,
8888 task_handle = taskhandle .DEFAULT_TASK_HANDLE , # FIXME: this is unused
8989 ):
9090 """Return the changes needed for this refactoring
@@ -335,7 +335,7 @@ def get_changes(
335335 # "Resource" has no attribute "has_child"
336336 if dest is None or not dest .exists ():
337337 raise exceptions .RefactoringError ("Move destination does not exist." )
338- if dest .is_folder () and dest .has_child ("__init__.py" ): # type:ignore
338+ if dest .is_folder () and dest .has_child ("__init__.py" ): # type: ignore[attr-defined]
339339 dest = dest .get_child ("__init__.py" ) # type:ignore
340340 # The previous guards protect against this mypy complaint:
341341 # Item "None" of "Union[str, Resource, None]" has no attribute "is_folder"
@@ -519,7 +519,10 @@ def __init__(self, project, resource):
519519 self .import_tools = self .tools .import_tools
520520
521521 def get_changes (
522- self , dest , resources = None , task_handle = taskhandle .DEFAULT_TASK_HANDLE
522+ self ,
523+ dest : resources .Resource ,
524+ resources : Optional [List [resources .File ]] = None ,
525+ task_handle = taskhandle .DEFAULT_TASK_HANDLE ,
523526 ):
524527 if resources is None :
525528 resources = self .project .get_python_files ()
0 commit comments