make_hashable
Attempt to make value hashable or raise a TypeError if it fails.
The returned value should generate the same hash for equal values.
def make_hashable(
value: Any
) - > Any
Attempt to make value hashable or raise a TypeError if it fails. The returned value should generate the same hash for equal values.
Parameters
| Name | Type | Description |
|---|---|---|
| value | Any | The object to be converted into a hashable format, such as a dictionary, list, or other nested collection. |
Returns
| Type | Description |
|---|---|
Any | A hashable version of the input value, typically converted to a sorted tuple of pairs for dictionaries or a tuple for other iterables. |