Sumtypes in Python.
Project description
Note: This package is in the dangerous land of
0.x.y
versions and may be subject to breaking changes with minor version increments.
nr.sumtype
Sumtypes in Python.
Example
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))
Copyright © 2020 Niklas Rosenstein
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.4.tar.gz
(4.7 kB
view hashes)
Built Distribution
Close
Hashes for nr.sumtype-0.0.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1017468bbc3d187592c413892c19d0e9642bdeae0149fa0c122ca21dfb23132 |
|
MD5 | 80a1de6d3d3624e2f354c279fcc244a6 |
|
BLAKE2b-256 | c6c1507a3efbef286e8241acd51b10df2c9868f77a8dae18d4c819ae2e50b900 |