Releases: leodiegues/unwrappy
Releases · leodiegues/unwrappy
unwrappy v0.1.0
Rust-inspired Result and Option types for Python.
unwrappy brings explicit, type-safe error handling to Python without the complexity of full functional programming libraries.
Highlights
Result[T, E]- Represent success (Ok) or failure (Err) as values, not exceptionsOption[T]- Handle optional values withSomeandNothing(no moreNoneambiguity)LazyResult&LazyOption- Clean async chaining without nested awaits- Pattern Matching - Native Python 3.10+ structural matching support
- Zero Dependencies - Pure Python, just stdlib
Why unwrappy?
from unwrappy import Ok, Err, Result
def divide(a: int, b: int) -> Result[float, str]:
if b == 0:
return Err("division by zero")
return Ok(a / b)
match divide(10, 2):
case Ok(value):
print(f"Result: {value}")
case Err(error):
print(f"Error: {error}")