Enums
packtype.utils.enum
get_entries(enum)
Iterate the entries of a Packtype enum. :yield: Tuple of the enum name, value, and whether it is the last entry
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
enum
|
Enum | type[Enum]
|
The Packtype enum to inspect |
required |
get_prefix(enum)
Get the prefix for an enum.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
enum
|
Enum | type[Enum]
|
The Packtype enum to inspect |
required |
Returns:
| Type | Description |
|---|---|
str
|
The prefix string |
is_enum(enum)
Check if a Packtype definition is an enum.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
enum
|
Enum | type[Enum]
|
The Packtype definition to inspect |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the definition is an enum, False otherwise |