Skip to main content

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.

Project description

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)

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

named_constants-1.0.tar.gz (3.8 kB view details)

Uploaded Source

File details

Details for the file named_constants-1.0.tar.gz.

File metadata

  • Download URL: named_constants-1.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for named_constants-1.0.tar.gz
Algorithm Hash digest
SHA256 0c5ff440351e2bef7b51271de237b6ac3011c563a93970f5dbe21a3eb6351f93
MD5 89510de8206d93c3474394d86f843dd3
BLAKE2b-256 f46ac1d59d246a378f01c6d157cdc3b1923d31bc7eb66fb33dc350dcac78ec31

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page