PKG-INFO 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. Metadata-Version: 1.0
  2. Name: enum
  3. Version: 0.4.4
  4. Summary: Robust enumerated type support in Python.
  5. Home-page: http://pypi.python.org/pypi/enum/
  6. Author: Ben Finney
  7. Author-email: ben+python@benfinney.id.au
  8. License: Choice of GPL or Python license
  9. Description: This package provides a module for robust enumerations in Python.
  10. An enumeration object is created with a sequence of string arguments
  11. to the Enum() constructor::
  12. >>> from enum import Enum
  13. >>> Colours = Enum('red', 'blue', 'green')
  14. >>> Weekdays = Enum('mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun')
  15. The return value is an immutable sequence object with a value for each
  16. of the string arguments. Each value is also available as an attribute
  17. named from the corresponding string argument::
  18. >>> pizza_night = Weekdays[4]
  19. >>> shirt_colour = Colours.green
  20. The values are constants that can be compared only with values from
  21. the same enumeration; comparison with other values will invoke
  22. Python's fallback comparisons::
  23. >>> pizza_night == Weekdays.fri
  24. True
  25. >>> shirt_colour > Colours.red
  26. True
  27. >>> shirt_colour == "green"
  28. False
  29. Each value from an enumeration exports its sequence index
  30. as an integer, and can be coerced to a simple string matching the
  31. original arguments used to create the enumeration::
  32. >>> str(pizza_night)
  33. 'fri'
  34. >>> shirt_colour.index
  35. 2
  36. Keywords: enum enumerated enumeration
  37. Platform: UNKNOWN
  38. Classifier: Development Status :: 4 - Beta
  39. Classifier: License :: OSI Approved :: GNU General Public License (GPL)
  40. Classifier: License :: OSI Approved :: Python Software Foundation License
  41. Classifier: Programming Language :: Python
  42. Classifier: Topic :: Software Development :: Libraries :: Python Modules
  43. Classifier: Operating System :: OS Independent
  44. Classifier: Intended Audience :: Developers