Skip to main content

Sumtypes in Python.

Project description

nr.sumtype

Make use of sumtypes in Python.

from nr.sumtype import Constructor, Sumtype

class Status(Sumtype):
  Idle = Constructor()
  Loading = Constructor(['progress'])
  Succeeded = Constructor()
  Error = Constructor(['message'])

print(Status.Loading(progress=0.0))

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

nr.sumtype-0.0.2.tar.gz (4.4 kB view details)

Uploaded Source

File details

Details for the file nr.sumtype-0.0.2.tar.gz.

File metadata

  • Download URL: nr.sumtype-0.0.2.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/42.0.2 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.6

File hashes

Hashes for nr.sumtype-0.0.2.tar.gz
Algorithm Hash digest
SHA256 df1f60c9a96c9d2778b3ff76e14ee090be176df67873e5606424ce746aa88b19
MD5 8063e36b23d6d9ce373ced7ddb40cc4c
BLAKE2b-256 c982492c8b8ac20034d0c9c2cdf619e93288ec9e7cd8068ab55f9fd64058ceb9

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