An enumeration is a set of symbolic names (members) bound to unique, constant values. Within an enumeration, the members can be compared by identity, and the enumeration itself can be iterated over.
from enum import Enum
- class Fruit(Enum):
apple = 1 banana = 2 orange = 3
list(Fruit) # [<Fruit.apple: 1>, <Fruit.banana: 2>, <Fruit.orange: 3>]
len(Fruit) # 3
Fruit.banana # <Fruit.banana: 2>
Fruit[‘banana’] # <Fruit.banana: 2>
Fruit(2) # <Fruit.banana: 2>
Fruit.banana is Fruit[‘banana’] is Fruit(2) # True
Fruit.banana.name # ‘banana’
Fruit.banana.value # 2
Repository and Issue Tracker at https://bitbucket.org/stoneleaf/enum34.
Release files for enum34 1.1.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| enum34-1.1.10.tar.gz | 28.2 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| enum34-1.1.10-py3-none-any.whl | Python 3 | none | any | Details |
| enum34-1.1.10-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 50.6 kB
Release files / enum34-1.1.10.tar.gz
| Download URL | enum34-1.1.10.tar.gz |
|---|---|
| Size | 28.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cce6a7477ed816bd2542d03d53db9f0db935dd013b70f336a95c73979289f248
|
|
BLAKE2b-256 checksum How to use checksums |
11c42da1f4952ba476677a42f25cd32ab8aaf0e1c0d0e00b89822b835c7e654c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.2rc1+
|
Release files / enum34-1.1.10-py3-none-any.whl
| Download URL | enum34-1.1.10-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c3858660960c984d6ab0ebad691265180da2b43f07e061c0f8dca9ef3cffd328
|
|
BLAKE2b-256 checksum How to use checksums |
63f6ccb1c83687756aeabbf3ca0f213508fcfb03883ff200d201b3a4c60cedcc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.2rc1+
|
Release files / enum34-1.1.10-py2-none-any.whl
| Download URL | enum34-1.1.10-py2-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
a98a201d6de3f2ab3db284e70a33b0f896fbf35f8086594e8c9e74b909058d53
|
|
BLAKE2b-256 checksum How to use checksums |
6f2ca9386903ece2ea85e9807e0e062174dc26fdce8b05f216d00491be29fad5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.2rc1+
|