Skip to content

Commit 6cdee7b

Browse files
authored
Delete unused symbol node (#14107)
IIRC `ImportedName` was used by old semantic analyzer, that is long gone now.
1 parent 77dd4b4 commit 6cdee7b

File tree

1 file changed

+0
-37
lines changed

1 file changed

+0
-37
lines changed

mypy/nodes.py

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -490,43 +490,6 @@ def accept(self, visitor: StatementVisitor[T]) -> T:
490490
return visitor.visit_import_all(self)
491491

492492

493-
class ImportedName(SymbolNode):
494-
"""Indirect reference to a fullname stored in symbol table.
495-
496-
This node is not present in the original program as such. This is
497-
just a temporary artifact in binding imported names. After semantic
498-
analysis pass 2, these references should be replaced with direct
499-
reference to a real AST node.
500-
501-
Note that this is neither a Statement nor an Expression so this
502-
can't be visited.
503-
"""
504-
505-
__slots__ = ("target_fullname",)
506-
507-
def __init__(self, target_fullname: str) -> None:
508-
super().__init__()
509-
self.target_fullname = target_fullname
510-
511-
@property
512-
def name(self) -> str:
513-
return self.target_fullname.split(".")[-1]
514-
515-
@property
516-
def fullname(self) -> str:
517-
return self.target_fullname
518-
519-
def serialize(self) -> JsonDict:
520-
assert False, "ImportedName leaked from semantic analysis"
521-
522-
@classmethod
523-
def deserialize(cls, data: JsonDict) -> ImportedName:
524-
assert False, "ImportedName should never be serialized"
525-
526-
def __str__(self) -> str:
527-
return f"ImportedName({self.target_fullname})"
528-
529-
530493
FUNCBASE_FLAGS: Final = ["is_property", "is_class", "is_static", "is_final"]
531494

532495

0 commit comments

Comments
 (0)