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.5.zip (44.7 kB view details)

Uploaded Source

enum34-1.1.5.tar.gz (40.0 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.5-py2.py3-none-any.whl (61.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file enum34-1.1.5.zip.

File metadata

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

File hashes

Hashes for enum34-1.1.5.zip
Algorithm Hash digest
SHA256 7580699f440ebc08ce51e04efd34e685264779e64bb5312112a785eac769e037
MD5 6c7c689da32248524f5967284139dd0b
BLAKE2b-256 f00b8a8665427c6ad17083958eb8df3987cde8206ad5c27c3ba17373316be34c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for enum34-1.1.5.tar.gz
Algorithm Hash digest
SHA256 35cf09a65db802269a76b7df60f548940575579a0e8a00ec45294995d28b0862
MD5 4c4ee33a974d5fa97e4f6e7bd56dddb7
BLAKE2b-256 6618bbdbe6a09b2dd4517913a8cd7aed246dc78ae11a9ed108b88e6695819ee4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for enum34-1.1.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 01a4abc326ead6c92169ab8c6f6af3cff9706a6a047c8738168f7a50b8def231
MD5 f99d5056e8fae92578a506fac6c5c720
BLAKE2b-256 a64bd2614fef376fcc5d0de1e86d1758c75ef79eda345ecfa07e0d16676706c3

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