Skip to content

Commit

Permalink
types
Browse files Browse the repository at this point in the history
  • Loading branch information
Carreau committed Oct 29, 2024
1 parent 0683bf0 commit cd28215
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/python/pyflyby/_autoimp.py
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,12 @@ def _visit_StoreImport(self, node, modulename):
value = _UseChecker(name, imp, self._lineno)
self._visit_Store(name, value)

def _visit_Store(self, fullname:str, value=None):
def _visit_Store(self, fullname: str, value: Optional[_UseChecker] = None):
"""
Visit a Store action, check for unused import
and add current value to the last scope.
"""
assert isinstance(value, (_UseChecker, type(None)))
logger.debug("_visit_Store(%r)", fullname)
if fullname is None:
return
Expand Down
2 changes: 1 addition & 1 deletion lib/python/pyflyby/_imports2s.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def pretty_print(self, params=None):
result = [block.pretty_print(params=params) for block in self.blocks]
return FileText.concatenate(result)

def find_import_block_by_lineno(self, lineno):
def find_import_block_by_lineno(self, lineno: int):
"""
Find the import block containing the given line number.
Expand Down

0 comments on commit cd28215

Please sign in to comment.