Code import
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
enum --- support for enumerations
|
||||
========================================
|
||||
|
||||
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.
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
pip
|
||||
@@ -0,0 +1,64 @@
|
||||
Metadata-Version: 2.0
|
||||
Name: enum34
|
||||
Version: 1.1.6
|
||||
Summary: Python 3.4 Enum backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4
|
||||
Home-page: https://bitbucket.org/stoneleaf/enum34
|
||||
Author: Ethan Furman
|
||||
Author-email: ethan@stoneleaf.us
|
||||
License: BSD License
|
||||
Platform: UNKNOWN
|
||||
Classifier: Development Status :: 5 - Production/Stable
|
||||
Classifier: Intended Audience :: Developers
|
||||
Classifier: License :: OSI Approved :: BSD License
|
||||
Classifier: Programming Language :: Python
|
||||
Classifier: Topic :: Software Development
|
||||
Classifier: Programming Language :: Python :: 2.4
|
||||
Classifier: Programming Language :: Python :: 2.5
|
||||
Classifier: Programming Language :: Python :: 2.6
|
||||
Classifier: Programming Language :: Python :: 2.7
|
||||
Classifier: Programming Language :: Python :: 3.3
|
||||
Classifier: Programming Language :: Python :: 3.4
|
||||
Classifier: Programming Language :: Python :: 3.5
|
||||
Provides: enum
|
||||
|
||||
enum --- support for enumerations
|
||||
========================================
|
||||
|
||||
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.
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
enum/LICENSE,sha256=iOxqbI6vo7l1fnRXg5OL7z9eTV48drHbV2qjq1IOXh0,1508
|
||||
enum/README,sha256=fyStyG6c3wxR2bHyZhLPNtc_ASDxGw-l8G6LzVxmkig,157
|
||||
enum/__init__.py,sha256=JSdYSXeZ1QSp67gjfI24quiePPtrlNXhXvm-pav8nuQ,31054
|
||||
enum34-1.1.6.dist-info/DESCRIPTION.rst,sha256=d1LpTdx9M07jJN0AmT-p6AAwLrX2guxOfmetcp_jljY,817
|
||||
enum34-1.1.6.dist-info/METADATA,sha256=p3ABlAtPlmU7-55UMHiwAd8o-wwS4EfZMsQWNoH1klg,1689
|
||||
enum34-1.1.6.dist-info/RECORD,,
|
||||
enum34-1.1.6.dist-info/WHEEL,sha256=bee59qcPjkyXfMaxNWjl2CGotqfumWx9pC1hlVLr2mM,92
|
||||
enum34-1.1.6.dist-info/metadata.json,sha256=1su5Y0gBxpWTAdey-06LrBSQzh-B1vAixlBxx4DJMOI,972
|
||||
enum34-1.1.6.dist-info/top_level.txt,sha256=jayVFfXRwPLUdgRN9GzacnFrOtEKQaAScXIY8mwgP8g,5
|
||||
enum34-1.1.6.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
||||
enum/__init__.pyc,,
|
||||
@@ -0,0 +1,5 @@
|
||||
Wheel-Version: 1.0
|
||||
Generator: bdist_wheel (0.29.0)
|
||||
Root-Is-Purelib: true
|
||||
Tag: py2-none-any
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{"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"], "extensions": {"python.details": {"contacts": [{"email": "ethan@stoneleaf.us", "name": "Ethan Furman", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "https://bitbucket.org/stoneleaf/enum34"}}}, "generator": "bdist_wheel (0.29.0)", "license": "BSD License", "metadata_version": "2.0", "name": "enum34", "provides": "enum", "summary": "Python 3.4 Enum backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4", "version": "1.1.6"}
|
||||
@@ -0,0 +1 @@
|
||||
enum
|
||||
Reference in New Issue
Block a user