Install & Compatibility
Where this runs
tested against v0.1a6 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.3MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 19MB
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
sumtype
✓ from sumtypes import sumtype
✗ from sumtypes import SumType
match
✓ from sumtypes import match
constructor
✓ from sumtypes import constructor
Define a sum type with three variants; pattern match using isinstance.
from sumtypes import SumType, Case, Enum
class Status(SumType):
Active = Case()
Inactive = Case()
Pending = Case(str)
statuses = [Status.Active(), Status.Inactive(), Status.Pending("waiting")]
for s in statuses:
if isinstance(s, Status.Active):
print("active")
elif isinstance(s, Status.Inactive):
print("inactive")
else:
print(f"pending: {s.value}")
Upgrade
Version history
0.1a6latest on PyPI · released Nov 30, 2021
Audit
Dependencies
No dependency data recorded yet.