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 Distributions

enum34-1.1.3.zip (44.5 kB view details)

Uploaded Source

enum34-1.1.3.tar.gz (39.8 kB view details)

Uploaded Source

Built Distribution

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

enum34-1.1.3-py2.py3-none-any.whl (61.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file enum34-1.1.3.zip.

File metadata

  • Download URL: enum34-1.1.3.zip
  • Upload date:
  • Size: 44.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for enum34-1.1.3.zip
Algorithm Hash digest
SHA256 d3c5a5241ca8670b20fa9629ec480b78382b18077d7f0de96e275f3ce1ca0a52
MD5 62608e6b0c209a0bedd3ed00796c13f0
BLAKE2b-256 eee45644bb98bc1e2e189b4d0d16ef76e4748ae8bb238ff20921eb64d4e9f5af

See more details on using hashes here.

File details

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

File metadata

  • Download URL: enum34-1.1.3.tar.gz
  • Upload date:
  • Size: 39.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for enum34-1.1.3.tar.gz
Algorithm Hash digest
SHA256 865506c22462236b3a2e87a7d9587633e18470e7a93a79b594791de2d31e9bc8
MD5 f31c81947ff8e54ec0eb162633d134ce
BLAKE2b-256 ec30c3b0a1bd6acf8dfa22d8d9634a46c13eea9b9ed19909d68263ea1094e24e

See more details on using hashes here.

File details

Details for the file enum34-1.1.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for enum34-1.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 994fe36b8fa494e37e60d3edefbd11c08dc2f884e26e35e71527f7e984890810
MD5 8c06365a725a6a1ba9b77404e46cf556
BLAKE2b-256 03ef643b63a6b93d77d2806744b983c67a45d7267c37dca34cc1a32695b95b99

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