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..
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 details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stringliteral-0.0.1.tar.gz.
File metadata
- Download URL: stringliteral-0.0.1.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
python-requests/2.25.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89dbe0742e5d978dec7941c1805a99f93a9c166a718327e57c1df2096accfa32
|
|
| MD5 |
2b543ed87434ec4d06871866cfe35eaa
|
|
| BLAKE2b-256 |
0b5fdfa1f04322442da76003eaed2d8177485a7ac0f92ba625e227fc42cef6ca
|
File details
Details for the file stringliteral-0.0.1-py3-none-any.whl.
File metadata
- Download URL: stringliteral-0.0.1-py3-none-any.whl
- Upload date:
- Size: 1.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
python-requests/2.25.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
885d26806d0efdc8765602762eaefdc752ce1c29918f6c361706ddb3d85df19f
|
|
| MD5 |
9ad288bd733c9ee47ab088905e867b5b
|
|
| BLAKE2b-256 |
eaf9cddff5a47401d540e986bbad3652d6c4ef7751ad6280dc58c9e5ef0e3f19
|