Skip to main content

stringliteral

Project description

Code style: black

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


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)

Uploaded Source

Built Distribution

stringliteral-0.0.1-py3-none-any.whl (1.9 kB view details)

Uploaded Python 3

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

Hashes for stringliteral-0.0.1.tar.gz
Algorithm Hash digest
SHA256 89dbe0742e5d978dec7941c1805a99f93a9c166a718327e57c1df2096accfa32
MD5 2b543ed87434ec4d06871866cfe35eaa
BLAKE2b-256 0b5fdfa1f04322442da76003eaed2d8177485a7ac0f92ba625e227fc42cef6ca

See more details on using hashes here.

File details

Details for the file stringliteral-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for stringliteral-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 885d26806d0efdc8765602762eaefdc752ce1c29918f6c361706ddb3d85df19f
MD5 9ad288bd733c9ee47ab088905e867b5b
BLAKE2b-256 eaf9cddff5a47401d540e986bbad3652d6c4ef7751ad6280dc58c9e5ef0e3f19

See more details on using hashes here.

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