Skip to main content

Module to set predefined allowed values for a variable

Project description

Enumy

The problem with Python's "Enum" module is that it is not a reasonable way to restrict variables to a predefined set of values.

Installation

pip install --user enumy

First start

from enumy import Enumy

test = Enumy(("Value 1", "Value 2"), str)
test = "Value 2"        # Working
test = 123              # Exception

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

enumy-1.0.1.tar.gz (1.8 kB view hashes)

Uploaded Source

Built Distribution

enumy-1.0.1-py3-none-any.whl (2.0 kB view hashes)

Uploaded Python 3

Supported by

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