Documentation menu

HasName

An interface for any node object that has a name.

View source on GitHub

Attributes


full_name


Returns the full name of the object, including the namespace path.

name


Retrieves the base name of the object without namespace prefixes.

Methods


get_name

Returns the name node of the object.

View source on GitHub

Returns

The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name.

rename

Sets the name of an object and updates all its usages.

View source on GitHub

Parameters

namerequired

The new name to assign to the object.

Returns

set_name

Sets the name of a code element.

View source on GitHub

Parameters

namerequired

The new name to set for the object.

Returns