Types
All core type hints to use throughout the entire package.
Classes:
|
Generic class for |
- class musify.types.MusifyEnum(new_class_name, /, names, *, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
IntEnumGeneric class for
IntEnumimplementations for the entire package.Methods:
map(enum)Optional mapper to apply to the enum found during
all(),from_name(), andfrom_value()callsall()Get all enums for this enum.
from_name(*names[, fail_on_many])Returns all enums that match the given enum names
from_value(*values[, fail_on_many])Returns all enums that match the given enum values
- classmethod map(enum)
Optional mapper to apply to the enum found during
all(),from_name(), andfrom_value()calls- Return type:
list[Self]
- classmethod all()
Get all enums for this enum.
- Return type:
list[Self]
- classmethod from_name(*names, fail_on_many=True)
Returns all enums that match the given enum names
- Parameters:
fail_on_many (
bool(default:True)) – If more than one enum is found, raise an exception.- Raises:
EnumNotFoundError – If a corresponding enum cannot be found.
- Return type:
list[Self]
- classmethod from_value(*values, fail_on_many=True)
Returns all enums that match the given enum values
- Parameters:
fail_on_many (
bool(default:True)) – If more than one enum is found, raise an exception.- Raises:
EnumNotFoundError – If a corresponding enum cannot be found.
- Return type:
list[Self]