gituser/production/: enum34-1.1.6 metadata and description

Homepage Simple index

Python 3.4 Enum backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4

author Ethan Furman
author_email ethan@stoneleaf.us
classifiers
  • Development Status :: 5 - Production/Stable
  • Intended Audience :: Developers
  • License :: OSI Approved :: BSD License
  • Programming Language :: Python
  • Topic :: Software Development
  • Programming Language :: Python :: 2.4
  • Programming Language :: Python :: 2.5
  • Programming Language :: Python :: 2.6
  • Programming Language :: Python :: 2.7
  • Programming Language :: Python :: 3.3
  • Programming Language :: Python :: 3.4
  • Programming Language :: Python :: 3.5
license BSD License
provides
  • enum
File Tox results History
enum34-1.1.6-py2-none-any.whl
Size
43 KB
Type
Python Wheel
Python
2
enum34-1.1.6-py3-none-any.whl
Size
12 KB
Type
Python Wheel
Python
3
enum34-1.1.6.tar.gz
Size
39 KB
Type
Source
enum34-1.1.6.zip
Size
44 KB
Type
Source

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.