Non Hashable Value Error¶
non_hashable_value_error
¶
Error raised when a field value cannot be converted to a hashable equivalent.
Raised when a value is neither natively hashable nor one of the
supported convertible types (list, dict).
NonHashableValueError
¶
Bases: ValueErrorMixin, Error[str]
Raised when a value cannot be made hashable during __hash__ computation.
Automatic hashability conversion supports list → tuple and
dict → frozenset of (key, value) pairs. Values of other
mutable types (e.g. bytearray, custom objects without __hash__)
trigger this error.
Source code in src/forging_blocks/foundation/errors/non_hashable_value_error.py
__init__(type_name: str, field_name: str | None = None) -> None
¶
Initialise the error with the name of the type that failed conversion.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
type_name
|
str
|
The |
required |
field_name
|
str | None
|
Optional field name where the value was encountered. |
None
|