Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

enum34-1.1.9.tar.gz (28.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

enum34-1.1.9-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

enum34-1.1.9-py2-none-any.whl (11.3 kB view details)

Uploaded Python 2

File details

Details for the file enum34-1.1.9.tar.gz.

File metadata

  • Download URL: enum34-1.1.9.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

Hashes for enum34-1.1.9.tar.gz
Algorithm Hash digest
SHA256 13ef9a1c478203252107f66c25b99b45b1865693ca1284aab40dafa7e1e7ac17
MD5 847df43504fee47bec9eb59861a59b80
BLAKE2b-256 a40494310230b388f6c1992cec62716229b5f2258ad14002346509152d398e3e

See more details on using hashes here.

File details

Details for the file enum34-1.1.9-py3-none-any.whl.

File metadata

  • Download URL: enum34-1.1.9-py3-none-any.whl
  • Upload date:
  • Size: 11.3 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

Hashes for enum34-1.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 708aabfb3d5898f99674c390d360d59efdd08547019763622365f19e84a7fef4
MD5 ca8cfbc101d8394651c673f5dbc6f605
BLAKE2b-256 df6e46a0304561a07bda942c4283b67228d5b87d1ebd1189c866ede4b4cd6a0a

See more details on using hashes here.

File details

Details for the file enum34-1.1.9-py2-none-any.whl.

File metadata

  • Download URL: enum34-1.1.9-py2-none-any.whl
  • Upload date:
  • Size: 11.3 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

Hashes for enum34-1.1.9-py2-none-any.whl
Algorithm Hash digest
SHA256 98df1f1937840b7d8012fea7f0b36392a3e6fd8a2f429c48a3ff4b1aad907f3f
MD5 14223791af1952870fd898aba0893188
BLAKE2b-256 bf04c2ab08074863e385ba27068f2da9df5e61e732664b0f932d396bbf46015b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page