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.
Raw data
{
"_id": null,
"home_page": "https://bitbucket.org/stoneleaf/enum34",
"name": "enum34",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Ethan Furman",
"author_email": "ethan@stoneleaf.us",
"download_url": "https://files.pythonhosted.org/packages/11/c4/2da1f4952ba476677a42f25cd32ab8aaf0e1c0d0e00b89822b835c7e654c/enum34-1.1.10.tar.gz",
"platform": "",
"description": "enum --- support for enumerations\n========================================\n\nAn enumeration is a set of symbolic names (members) bound to unique, constant\nvalues. Within an enumeration, the members can be compared by identity, and\nthe enumeration itself can be iterated over.\n\n from enum import Enum\n\n class Fruit(Enum):\n apple = 1\n banana = 2\n orange = 3\n\n list(Fruit)\n # [<Fruit.apple: 1>, <Fruit.banana: 2>, <Fruit.orange: 3>]\n\n len(Fruit)\n # 3\n\n Fruit.banana\n # <Fruit.banana: 2>\n\n Fruit['banana']\n # <Fruit.banana: 2>\n\n Fruit(2)\n # <Fruit.banana: 2>\n\n Fruit.banana is Fruit['banana'] is Fruit(2)\n # True\n\n Fruit.banana.name\n # 'banana'\n\n Fruit.banana.value\n # 2\n\nRepository and Issue Tracker at https://bitbucket.org/stoneleaf/enum34.\n\n\n",
"bugtrack_url": null,
"license": "BSD License",
"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.10",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "85f9f5509176e863bb723e10f44cd317",
"sha256": "a98a201d6de3f2ab3db284e70a33b0f896fbf35f8086594e8c9e74b909058d53"
},
"downloads": -1,
"filename": "enum34-1.1.10-py2-none-any.whl",
"has_sig": false,
"md5_digest": "85f9f5509176e863bb723e10f44cd317",
"packagetype": "bdist_wheel",
"python_version": "py2",
"requires_python": null,
"size": 11223,
"upload_time": "2020-03-10T17:47:58",
"upload_time_iso_8601": "2020-03-10T17:47:58.095095Z",
"url": "https://files.pythonhosted.org/packages/6f/2c/a9386903ece2ea85e9807e0e062174dc26fdce8b05f216d00491be29fad5/enum34-1.1.10-py2-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "c2bab643d4e8fd032973b312037a9164",
"sha256": "c3858660960c984d6ab0ebad691265180da2b43f07e061c0f8dca9ef3cffd328"
},
"downloads": -1,
"filename": "enum34-1.1.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c2bab643d4e8fd032973b312037a9164",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 11224,
"upload_time": "2020-03-10T17:48:03",
"upload_time_iso_8601": "2020-03-10T17:48:03.174785Z",
"url": "https://files.pythonhosted.org/packages/63/f6/ccb1c83687756aeabbf3ca0f213508fcfb03883ff200d201b3a4c60cedcc/enum34-1.1.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "b5ac0bb5ea9e830029599e410d09d3b5",
"sha256": "cce6a7477ed816bd2542d03d53db9f0db935dd013b70f336a95c73979289f248"
},
"downloads": -1,
"filename": "enum34-1.1.10.tar.gz",
"has_sig": false,
"md5_digest": "b5ac0bb5ea9e830029599e410d09d3b5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 28187,
"upload_time": "2020-03-10T17:48:00",
"upload_time_iso_8601": "2020-03-10T17:48:00.865495Z",
"url": "https://files.pythonhosted.org/packages/11/c4/2da1f4952ba476677a42f25cd32ab8aaf0e1c0d0e00b89822b835c7e654c/enum34-1.1.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2020-03-10 17:48:00",
"github": false,
"gitlab": false,
"bitbucket": true,
"bitbucket_user": "stoneleaf",
"bitbucket_project": "enum34",
"lcname": "enum34"
}