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.
Note: The
nr.sumtype
module is no longer developed.
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.5.tar.gz
(5.1 kB
view hashes)
Built Distribution
Close
Hashes for nr.sumtype-0.0.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdc2f73d4f96384ab8ae7b8094c26180c61c6f9b33eeb2e03f44ff2e3afa441d |
|
MD5 | 20a8a288600b4cbbc36e33e17f0a4397 |
|
BLAKE2b-256 | 5cac0e805e7012ccb07faefc27113e1ee38defaf7d90c4461e40541d4d38d237 |