Typesļ
All core type hints to use throughout the entire package.
Classes:
|
Generic class for |
- class musify.types.MusifyEnum(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)ļ
Bases:
IntEnum
Generic class for
IntEnum
implementations 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
]