lock_attr
lock an attribute name
Last updated
lock an attribute name
Last updated
Locks an attribute name from reassignment. Nothing is returned. Attribute names that are locked cannot be reassigned to a new value, but a locked attribute name can be deleted or unlocked (See ). If there is an attempt to reassign an attribute name that is currently locked, an exception will be thrown. Attribute names must already exist to lock them.
You cannot have an attribute name locked and simultaneously. Only one lock type can be used on an attribute name at a time.
Basic Example of locking a name using default positional parameter
In this example, we simply lock an attribute name that already exists in the using the lock_attr method and pass a string of the attribute name as an argument to the method to lock the name.
Methods that provide related utility to this method
-> Unlock an attribute name -> View all the currently locked attribute names
Describes all parameter functionality and accepted data types