setattr

setattr(object, name, value)

Defines the attribute (built-in).

object??
name??
value??

REMARKS
* No prefix required - Core
* This is the counterpart of getattr(). The arguments are an object, a string, and an arbitrary value. The string may name an existing attribute or a new attribute. The function assigns the value to the attribute, provided the object allows it. For example, setattr(x, 'foobar', 123) is equivalent to x.foobar = 123.
* name need not be a Python identifier as defined in Identifiers and keywords unless the object chooses to enforce that, for example in a custom __getattribute__() or via __slots__. An attribute whose name is not an identifier will not be accessible using the dot notation, but is accessible through getattr() etc..
* link to getattr
* You can use the GETATTR function to
* You can use the HASATTR function to
* You can use the DELATTR function to
* For the Official documentation refer to python.org

?? 

© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited Top