Name¶
- class astroid.nodes.Name(name: str, lineno: int, col_offset: int, parent: NodeNG, *, end_lineno: int | None, end_col_offset: int | None)[source]¶
Bases:
LookupMixIn,NoChildrenNodeClass representing an
ast.Namenode.A
Namenode is something that is named, but not covered byAssignNameorDelName.>>> import astroid >>> node = astroid.extract_node('range(10)') >>> node <Call l.1 at 0x7effe1db8710> >>> list(node.get_children()) [<Name.range l.1 at 0x7effe1db86a0>, <Const.int l.1 at 0x7effe1db8518>] >>> list(node.get_children())[0].as_string() 'range'
- name¶
The name that this node refers to.