METADATA 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. Metadata-Version: 2.1
  2. Name: enum34
  3. Version: 1.1.10
  4. Summary: Python 3.4 Enum backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4
  5. Home-page: https://bitbucket.org/stoneleaf/enum34
  6. Author: Ethan Furman
  7. Author-email: ethan@stoneleaf.us
  8. License: BSD License
  9. Platform: UNKNOWN
  10. Classifier: Development Status :: 5 - Production/Stable
  11. Classifier: Intended Audience :: Developers
  12. Classifier: License :: OSI Approved :: BSD License
  13. Classifier: Programming Language :: Python
  14. Classifier: Topic :: Software Development
  15. Classifier: Programming Language :: Python :: 2.4
  16. Classifier: Programming Language :: Python :: 2.5
  17. Classifier: Programming Language :: Python :: 2.6
  18. Classifier: Programming Language :: Python :: 2.7
  19. Classifier: Programming Language :: Python :: 3.3
  20. Provides: enum
  21. enum --- support for enumerations
  22. ========================================
  23. An enumeration is a set of symbolic names (members) bound to unique, constant
  24. values. Within an enumeration, the members can be compared by identity, and
  25. the enumeration itself can be iterated over.
  26. from enum import Enum
  27. class Fruit(Enum):
  28. apple = 1
  29. banana = 2
  30. orange = 3
  31. list(Fruit)
  32. # [<Fruit.apple: 1>, <Fruit.banana: 2>, <Fruit.orange: 3>]
  33. len(Fruit)
  34. # 3
  35. Fruit.banana
  36. # <Fruit.banana: 2>
  37. Fruit['banana']
  38. # <Fruit.banana: 2>
  39. Fruit(2)
  40. # <Fruit.banana: 2>
  41. Fruit.banana is Fruit['banana'] is Fruit(2)
  42. # True
  43. Fruit.banana.name
  44. # 'banana'
  45. Fruit.banana.value
  46. # 2
  47. Repository and Issue Tracker at https://bitbucket.org/stoneleaf/enum34.