Core
HasName
An interface for any node object that has a name.
View Source on Github
Attributes
full_name
str | None
Returns the full name of the object, including the namespace path.
name
str | None
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
name
str
required
The new name to assign to the object.
Returns
None
set_name
Sets the name of a code element.
View Source on Github
Parameters
name
str
required
The new name to set for the object.
Returns
None