Yet Another Enumerator is an enum module that supports three different types of enumerations:
sequence enums (0, 1, 2, 3, etc.)
base 2 bitmask enums (0, 1, 2, 4, 8, etc.)
string enums (‘top’,’bottom’,’left’,’right’, etc.)
Each Enumeration is its own class, with instances of that class being singletons. Besides being a value, enum instances can also have their own behavior (use case, anyone?).
Creating an enum is as simple as:
from yaenum import Enum, BitMaskEnum, UniqueEnum, enum
Enum.create('Color', 'red green blue', export=globals())
or:
class Color(BitMaskEnum): # python 3+ only
black
red
green
blue
and if that’s too magical for you:
class Color(BitMaskEnum):
black = enum() # python 2: enum(value=0) etc.
red = enum()
green = enum()
blue = enum()
Metadata
Release files for yaenum 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distributions (sdists)
| File | Size | Uploaded | |
|---|---|---|---|
| yaenum-0.1.zip | 12.6 kB | Details | |
| yaenum-0.1.tar.gz | 8.3 kB | Details |
Release files / yaenum-0.1.zip
| Download URL | yaenum-0.1.zip |
|---|---|
| Size | 12.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b6fd7bcdaf52cb2e8f7958c72e24cea28cc202f4cfe5e5ee64d2020055131ee9
|
|
BLAKE2b-256 checksum How to use checksums |
7ed2bdff4b33b47f225fd7f6ad8d5902a6fd9db57f1969b2cfd9d364d8b43d34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / yaenum-0.1.tar.gz
| Download URL | yaenum-0.1.tar.gz |
|---|---|
| Size | 8.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ee17c20c43145a26a39fd55fbdfbe16d98649b977bd73ae652218ad5c920a6bb
|
|
BLAKE2b-256 checksum How to use checksums |
774ab9d03edf9500c003ceeb1409cdaf4bd3e3fc47a68d08489c77a7cc97b03a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |