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.6.zip (44.8 kB view details)

Uploaded Source

enum34-1.1.6.tar.gz (40.0 kB view details)

Uploaded Source

Built Distributions

enum34-1.1.6-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

enum34-1.1.6-py2-none-any.whl (12.4 kB view details)

Uploaded Python 2

File details

Details for the file enum34-1.1.6.zip.

File metadata

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

File hashes

Hashes for enum34-1.1.6.zip
Algorithm Hash digest
SHA256 2d81cbbe0e73112bdfe6ef8576f2238f2ba27dd0d55752a776c41d38b7da2850
MD5 61ad7871532d4ce2d77fac2579237a9e
BLAKE2b-256 e826a6101edcf724453845c850281b96b89a10dac6bd98edebc82634fccce6a5

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for enum34-1.1.6.tar.gz
Algorithm Hash digest
SHA256 8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1
MD5 5f13a0841a61f7fc295c514490d120d0
BLAKE2b-256 bf3e31d502c25302814a7c2f1d3959d2a3b3f78e509002ba91aea64993936876

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for enum34-1.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 644837f692e5f550741432dd3f223bbb9852018674981b1664e5dc339387588a
MD5 a63ecb4f0b1b85fb69be64bdea999b43
BLAKE2b-256 af42cb9355df32c69b553e72a2e28daee25d1611d2c0d9c272aa1d34204205b2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for enum34-1.1.6-py2-none-any.whl
Algorithm Hash digest
SHA256 6bd0f6ad48ec2aa117d3d141940d484deccda84d4fcd884f5c3d93c23ecd8c79
MD5 68f6982cc07dde78f4b500db829860bd
BLAKE2b-256 c5dbe56e6b4bbac7c4a06de1c50de6fe1ef3810018ae11732a50f15f62c7d050

See more details on using hashes here.

Supported by

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