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.4.zip (44.5 kB view details)

Uploaded Source

enum34-1.1.4.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.4-py2.py3-none-any.whl (61.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file enum34-1.1.4.zip.

File metadata

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

File hashes

Hashes for enum34-1.1.4.zip
Algorithm Hash digest
SHA256 c0379e8193e55dbb84892cddab4eb5cb965b3176f8442378994ca4de4b3a8b27
MD5 250b8cd9ff404fdbfbf645d7f491b26a
BLAKE2b-256 66b9ea04f447a7815b4774544e8970a7983312e6920c18445020d3e97b871eb8

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for enum34-1.1.4.tar.gz
Algorithm Hash digest
SHA256 0efc3e3ee0cb7cc12ea9e4813cdf1154f69ab47e518f4924fbd9e238df41d628
MD5 4d54e15da1558b399a402756c729459a
BLAKE2b-256 ebc2ea4077a72a167fb75f38bac63801910dfa2d5083e23ddaa0c4062848f78c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for enum34-1.1.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 fb882434f2ae319f454b6b5d07bfac73104a16c1fcdbb30c3cef70df216610e9
MD5 c41dcd04e1077e7bb533e4328d48939e
BLAKE2b-256 303c7b6debc06c8f6bbfa20104fa31aeaae4a425e45c51f3522d87e35dcfc910

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