setattr(object, name, value)

Returns test


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

?? 

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