DelName#

class astroid.nodes.DelName(name: str, lineno: int, col_offset: int, parent: NodeNG, *, end_lineno: int | None, end_col_offset: int | None)[source]#

Bases: NoChildrenNode, LookupMixIn, ParentAssignNode

Variation of ast.Delete representing deletion of a name.

A DelName is the name of something that is deleted.

>>> import astroid
>>> node = astroid.extract_node("del variable #@")
>>> list(node.get_children())
[<DelName.variable l.1 at 0x7effe1da4d30>]
>>> list(node.get_children())[0].as_string()
'variable'
name#

The name that is being deleted.