Python 3.4 Enum backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file enum34-1.1.10.tar.gz
.
File metadata
- Download URL: enum34-1.1.10.tar.gz
- Upload date:
- Size: 28.2 kB
- Tags: Source
- Uploaded using 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+
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cce6a7477ed816bd2542d03d53db9f0db935dd013b70f336a95c73979289f248 |
|
MD5 | b5ac0bb5ea9e830029599e410d09d3b5 |
|
BLAKE2b-256 | 11c42da1f4952ba476677a42f25cd32ab8aaf0e1c0d0e00b89822b835c7e654c |
File details
Details for the file enum34-1.1.10-py3-none-any.whl
.
File metadata
- Download URL: enum34-1.1.10-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using 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+
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3858660960c984d6ab0ebad691265180da2b43f07e061c0f8dca9ef3cffd328 |
|
MD5 | c2bab643d4e8fd032973b312037a9164 |
|
BLAKE2b-256 | 63f6ccb1c83687756aeabbf3ca0f213508fcfb03883ff200d201b3a4c60cedcc |
File details
Details for the file enum34-1.1.10-py2-none-any.whl
.
File metadata
- Download URL: enum34-1.1.10-py2-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 2
- Uploaded using 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+
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a98a201d6de3f2ab3db284e70a33b0f896fbf35f8086594e8c9e74b909058d53 |
|
MD5 | 85f9f5509176e863bb723e10f44cd317 |
|
BLAKE2b-256 | 6f2ca9386903ece2ea85e9807e0e062174dc26fdce8b05f216d00491be29fad5 |