Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b8f0a71

Browse files
authored
Add typing to newly added methods
1 parent a70a1fe commit b8f0a71

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

IPython/extensions/autoreload.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ def __call__(self):
470470

471471

472472
class ImportFromTracker:
473-
def __init__(self, imports_froms, symbol_map):
473+
def __init__(self, imports_froms: dict, symbol_map: dict):
474474
self.imports_froms = imports_froms
475475
# symbol_map maps original_name -> list of resolved_names
476476
self.symbol_map = {}
@@ -485,7 +485,7 @@ def __init__(self, imports_froms, symbol_map):
485485
else:
486486
self.symbol_map = symbol_map or {}
487487

488-
def add_import(self, module_name, original_name, resolved_name):
488+
def add_import(self, module_name: str, original_name: str, resolved_name: str) -> None:
489489
"""Add an import, handling conflicts with existing imports.
490490
491491
This method is called after successful code execution, so we know the import is valid.
@@ -870,7 +870,7 @@ def post_execute_hook(self):
870870

871871
self.loaded_modules.update(newly_loaded_modules)
872872

873-
def _track_imports_from_code(self, code):
873+
def _track_imports_from_code(self, code: str) -> None:
874874
"""Track import statements from executed code"""
875875
try:
876876
tree = ast.parse(code)

0 commit comments

Comments
 (0)