> For the complete documentation index, see [llms.txt](https://docs.macilib.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.macilib.org/docs/maci/object/methods/hard_lock_attr.md).

# hard\_lock\_attr

Hard Locks an attribute name from reassignment, unlocking, and deletion. Nothing is returned.\
\
Attribute names that are hard-locked cannot be reassigned to a new value, unlocked, or deleted. If there is an attempt to reassign, unlock, or delete an attribute name that is currently hard-locked, an exception will be thrown. Attribute names must already exist to hard lock them.

The [unlock\_attr](/docs/maci/object/methods/unlock_attr.md) method does not evaluate the hard-locked attribute names at all and will throw an exception stating the name does not exist in [lock](/docs/maci/object/methods/lock_attr.md).

You cannot have an attribute name hard-locked and [locked](/docs/maci/object/methods/lock_attr.md) simultaneously. Only one lock type can be used on an attribute name at a time.<br>

*Basic Example of hard-locking a name using default positional parameter*

```python
data.hard_lock_attr('attr_name')
```

In this example, we simply hard-lock an attribute name that already exists in the [MaciDataObj](/docs/maci/object.md) using the hard\_lock\_attr method and pass a string of the attribute name as an argument to the method to hard-lock the name.

### partner methods

Methods that provide related utility to this method

[get\_hard\_locked\_list](/docs/maci/object/methods/get_hard_locked_list.md)  ->  View all the current hard-locked attribute names

### parameters & arguments

Describes all parameter functionality and accepted data types

<details>

<summary>attr_name:  str</summary>

First and only required positional argument. Accepts strings

Use this parameter to pick attribute name to hard-lock

</details>
