Python 3.4 Enum backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4
Project Links
Meta
Author: Ethan Furman
Classifiers
Development Status
- 5 - Production/Stable
Intended Audience
- Developers
License
- OSI Approved :: BSD License
Programming Language
- Python :: 2.4
- Python :: 2.5
- Python :: 2.6
- Python :: 2.7
- Python :: 3
Topic
- Software Development
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.
Mar 10, 2020
1.1.10
Feb 22, 2020
1.1.9
Feb 22, 2020
1.1.8
May 16, 2016
1.1.6
May 08, 2016
1.1.5
Apr 26, 2016
1.1.4
Apr 14, 2016
1.1.3
Dec 22, 2015
1.1.2
Nov 29, 2015
1.1.1
Nov 29, 2015
1.1.0
Nov 26, 2014
1.0.4
Oct 21, 2014
1.0.3
Oct 21, 2014
1.0.2
Oct 21, 2014
1.0.1
May 05, 2014
1.0
Feb 13, 2014
0.9.23
Feb 12, 2014
0.9.22
Feb 07, 2014
0.9.21
Jan 30, 2014
0.9.20
Oct 09, 2013
0.9.19
Sep 04, 2013
0.9.18
Sep 04, 2013
0.9.17
Aug 12, 2013
0.9.16
Aug 12, 2013
0.9.15
Jul 30, 2013
0.9.14
Jul 25, 2013
0.9.13
Jul 23, 2013
0.9.12
Jul 01, 2013
0.9.11
Jul 01, 2013
0.9.1
Jun 16, 2013
0.9
Wheel compatibility matrix
Files in release
No dependencies