Skip to main content

Advanced Enumerations (compatible with Python's stdlib Enum), NamedTuples, and NamedConstants

Project description

Advanced Enumerations (compatible with Python’s stdlib Enum), NamedTuples, and NamedConstants

aenum includes a Python stdlib Enum-compatible data type, as well as a metaclass-based NamedTuple implementation and a NamedConstant class.

An Enum 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. If using Python 3 there is built-in support for unique values, multiple values, auto-numbering, and suspension of aliasing (members with the same value are not identical), plus the ability to have values automatically bound to attributes.

A NamedTuple is a class-based, fixed-length tuple with a name for each possible position accessible using attribute-access notation as well as the standard index notation.

A NamedConstant is a class whose members cannot be rebound; it lacks all other Enum capabilities, however; consequently, it can have duplicate values.

Utility functions include:

  • skip: class that prevents attributes from being converted to a

    constant or enum member

  • module: inserts NamedConstant and Enum classes into sys.modules

    where it will appear to be a module whose top-level names cannot be rebound

  • extend_enum: add new members to enumerations after creation

  • enum: helper class for creating members with keywords

  • constant: helper class for creating constant members

Project details


Download files

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

Source Distributions

aenum-1.4.2.zip (71.1 kB view details)

Uploaded Source

aenum-1.4.2.tar.gz (65.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aenum-1.4.2-py2.py3-none-any.whl (67.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file aenum-1.4.2.zip.

File metadata

  • Download URL: aenum-1.4.2.zip
  • Upload date:
  • Size: 71.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for aenum-1.4.2.zip
Algorithm Hash digest
SHA256 1f33c82ff125bf6ec4802253381be9fa1923679668fa5728d32af423f782ed45
MD5 c530a5e74ce4ba213f036c0257e37645
BLAKE2b-256 b2b5f333229f33f88d7ca6c68fb99bad8896cf87748273062cf41b1ac5c8af88

See more details on using hashes here.

File details

Details for the file aenum-1.4.2.tar.gz.

File metadata

  • Download URL: aenum-1.4.2.tar.gz
  • Upload date:
  • Size: 65.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for aenum-1.4.2.tar.gz
Algorithm Hash digest
SHA256 7898b7dcfa2ed24239c2b6cd071cdce2dd25e85d10c28d3c1e737b42d15b2add
MD5 fae14b3d8378c6443a0d8e8fb1848597
BLAKE2b-256 7f03a4ee4bd35d52a0a7a59404dd4a5712a0914dd6996698b666efc58ac780a9

See more details on using hashes here.

File details

Details for the file aenum-1.4.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for aenum-1.4.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 54b10a2d2e23c8ef55a0ae157cbb62dd4a91475837fb8a63201783336fa28c04
MD5 224d5163cfc0ca9be3e63232624b9eea
BLAKE2b-256 28968e73f3e9157fffd12a0413fdc7260bb9582a546c3d5c60f2a245683e7256

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