Skip to content

Commit a0bd6bc

Browse files
bluetechmsullivan
authored andcommitted
New analyzer: don't fill ImportAll.imported_names (#7271)
It is used by aststrip.py, but not by aststripnew.py, so the new semantic analyzer doesn't need it. Ignoring it makes some future changes easier.
1 parent 97d9205 commit a0bd6bc

File tree

3 files changed

+1
-2
lines changed

3 files changed

+1
-2
lines changed

mypy/newsemanal/semanal.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1852,7 +1852,6 @@ def visit_import_all(self, i: ImportAll) -> None:
18521852
name, existing_symbol, node, i):
18531853
continue
18541854
self.add_imported_symbol(name, node, i)
1855-
i.imported_names.append(name)
18561855
else:
18571856
# Don't add any dummy symbols for 'from x import *' if 'x' is unknown.
18581857
pass

mypy/nodes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ class ImportAll(ImportBase):
368368
"""from m import *"""
369369
id = None # type: str
370370
relative = None # type: int
371+
# NOTE: Only filled and used by old semantic analyzer.
371372
imported_names = None # type: List[str]
372373

373374
def __init__(self, id: str, relative: int) -> None:

mypy/server/aststripnew.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ def visit_import_from(self, node: ImportFrom) -> None:
152152

153153
def visit_import_all(self, node: ImportAll) -> None:
154154
node.assignments = []
155-
node.imported_names = []
156155

157156
def visit_for_stmt(self, node: ForStmt) -> None:
158157
node.index_type = node.unanalyzed_index_type

0 commit comments

Comments
 (0)