示例#1
0
    def visit_import_all(self, node: ImportAll) -> None:
        # Imports can include both overriding symbols and fresh ones,
        # and we need to clear both.
        node.assignments = []

        # If the node is unreachable, we don't want to reset entries from a reachable import.
        if node.is_unreachable:
            return
        # Reset entries in the symbol table that were added through the statement.
        # (The description in visit_import is relevant here as well.)
        if self.names:
            for name in node.imported_names:
                if name in self.names:
                    del self.names[name]
        node.imported_names = []
示例#2
0
    def visit_import_all(self, node: ImportAll) -> None:
        # Imports can include both overriding symbols and fresh ones,
        # and we need to clear both.
        node.assignments = []

        # If the node is unreachable, we don't want to reset entries from a reachable import.
        if node.is_unreachable:
            return
        # Reset entries in the symbol table that were added through the statement.
        # (The description in visit_import is relevant here as well.)
        if self.names:
            for name in node.imported_names:
                if name in self.names:
                    del self.names[name]
        node.imported_names = []
示例#3
0
 def visit_import_all(self, node: ImportAll) -> None:
     node.assignments = []
     node.imported_names = []
示例#4
0
 def visit_import_all(self, node: ImportAll) -> None:
     node.assignments = []
     node.imported_names = []