def visit_Constant(self, node): if not hasattr(node, 'isdoc'): value = value_of(node) return ast.Name(id=self.env.constants[value].name) else: return node
def visit_Constant(self, node): if not hasattr(node, 'isdoc'): value = value_of(node) return self.add_constant(node, value)
def add_assignment(self, left_name, right_node): val = value_of(right_node) self.aliases[val] = left_name self.assignments[left_name] = right_node