stringliteral
Project description
stringliteral
from stringliteral import StringLiteral
class AllowedValues(StringLiteral):
LEFT="left"
RIGHT="right"
value = AllowedValues.LEFT
AllowedValues.contains("left") # returns True
AllowedValues.contains("up") # returns False
Define your class attributes with ALL CAPS only. Non CAP attributes will be ignored.
I created this for my own usage after tripping over using the built in Enum class many, many times..
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
stringliteral-0.0.1.tar.gz
(5.0 kB
view hashes)
Built Distribution
Close
Hashes for stringliteral-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 885d26806d0efdc8765602762eaefdc752ce1c29918f6c361706ddb3d85df19f |
|
MD5 | 9ad288bd733c9ee47ab088905e867b5b |
|
BLAKE2b-256 | eaf9cddff5a47401d540e986bbad3652d6c4ef7751ad6280dc58c9e5ef0e3f19 |