Skip to main content

Decorator to automatically create Enum with filled values

Project description

libqtum

GitHub license PyPI Version

This Decorator returns an Enum, which contains all values in values.

Values, which the passed class not include, will be auto generated with prefix + value as name if they are in the values list.

Args: values: An iterable list of values for the Enum members. enum_cls: The Enum class or a subclass of it. prefix: The prefix for the name of the auto generated Enum members. *args: Will be passed to the enum_cls constructor. **kwargs: Will be passed to the enum_cls constructor.

Gitlab Snippet

Original Blog Post

Project details


Download files

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

Source Distribution

fill_enum-0.1.0.tar.gz (3.6 kB view hashes)

Uploaded source

Built Distribution

fill_enum-0.1.0-py2.py3-none-any.whl (3.4 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page