skip to navigation
skip to content

named_constants 1.0

This module offers an easy way to define named constants in Python, supporting some simple enum-like use case, as well as arbitrary value types like strings or floats.

This module offers an easy way to define named constants in Python, supporting some simple enum-like use case, as well as arbitrary value types like strings or floats. It is rather simple to use and does not have a big footprint, but supports the following features:

  • Ease of use (a simple class for scoping, plain definitions inside)
  • Enumeration of defined constants
  • Values know their name, i.e. you don’t have to guess which meaning the constant value 3 has (e.g. it’s name() will be ‘blue’ and its __repr__ will format as ‘Colors.blue’)
  • Arbitrary value types (not just integers)
  • Constant-ness (no change after time of definition)
 
File Type Py Version Uploaded on Size
named_constants-1.0.tar.gz (md5, pgp) Source 2014-11-21 3KB