_uuid_key
Module Contents
Classes
A class where each instance has a UUID. |
|
Wraps a value and implements __eq__ and __hash__ based purely on id(value). |
- class HasUUID
Bases:
Protocol
A class where each instance has a UUID.
- property uuid: uuid.UUID
Get the uuid.
- Returns:
The uuid.
# noqa: DAR202
- class UUIDKey(value: _T)
Bases:
Generic
[_T
]Wraps a value and implements __eq__ and __hash__ based purely on id(value).
- property value: _T
Get the wrapped value.
- Returns:
The value.
- __eq__(other: object) bool
Compare with another wrapped value using their ids.
- Parameters:
other – The object to compare with.
- Returns:
Whether their ids are equal.
- Raises:
ValueError – If the other objecgt is not an UUIDKey.
- __hash__() int
Hash this object using its id only.
- Returns:
The hash.