Make your functions return something meaningful, typed, and safe! Features Provides a bunch of primitives to write declarative business logic Enforces better architecture Fully typed with annotations and checked with mypy, PEP561 compatible Has a bunch of helpers for better composition Pythonic and pleasant to write and to read 🐍 Support functions and coroutines, framework agnostic Easy to start: has lots of docs, tests, and tutorials Installation pip install returns You might also want to configure mypy correctly and install our plugin to fix this existing issue: # In setup.cfg or mypy.ini: [mypy] plugins = returns.contrib.mypy.decorator_plugin We also recommend to use the same mypy settings we use. Make sure you know how to get started, check out our docs! Contents Maybe container that allows you to write None-free code RequiresContext container that allows you to use typed functional dependency injection Result container that let's you…
If you like functional programming, static type checking, and Python then you should probably check out dry-python/returns library.
It is a collection of typed monads, transformers, and composition helpers. Works great with and without
mypy
.Check it out!
dry-python / returns
Make your functions return something meaningful, typed, and safe!
Make your functions return something meaningful, typed, and safe!
Features
mypy
, PEP561 compatibleInstallation
You might also want to configure
mypy
correctly and install our plugin to fix this existing issue:We also recommend to use the same
mypy
settings we use.Make sure you know how to get started, check out our docs!
Contents
None
-free code