We follow Semantic Versions since the 1.0.0
release.
Versions before 1.0.0
are 0Ver
-based:
incremental in minor, bugfixes only are patches.
See 0Ver.
-
Breaking: renames
join
toflatten
, sorry! -
Breaking: renames
box
tobind
and moves it toreturns.pointfree
-
Breaking: removes
Maybe.rescue
andMaybe.fix
methods -
Breaking: renames
io_squash
tosquash_io
and moves it toreturns.converters
-
Breaking: moves all interfaces from
returns.primitives.container
toreturns.primitives.interfaces
-
Adds
rescue
pointfree function -
Adds
ResultE
alias forResult[..., Exception]
-
Adds
RequiresContext
container andContext
helper class -
Adds
RequiresContext
support forbind
pointfree function -
Adds
RequiresContext
support forflatten
function -
Adds
RequiresContextResult
container -
Adds
RequiresContextResultE
alias -
Adds
ReaderResult
andReaderResultE
aliases forRequiresContextResult[..., ..., Exception]
-
Adds
RequiresContextResult
support forbind
andrescue
-
Adds
RequiresContextResult
support forflatten
-
Adds
IOResult
helper to work better withIO[Result[a, b]]
-
Adds
IOResultE
alias forIOResult[a, Exception]
-
Adds
IOResult
support forbind
-
Adds
IOResult
support forflatten
-
Adds
IOResult
support for@pipeline
-
Adds
IOResult
support forcoalesce
-
Adds
IOResult
support foris_successful
-
Adds
RequiresContextIOResult
container -
Adds
RequiresContextIOResultE
alias -
Adds
ReaderIOResult
andReaderIOResultE
aliases forRequiresContextIOResult[..., ..., Exception]
-
Adds
RequiresContextIOResult
support forbind
andrescue
-
Adds
RequiresContextIOResult
support forflatten
-
Adds
Result.lift
,Maybe.lift
,RequiresContext.lift
, andRequiresContextResult.lift
functions in addition toIO.lift
-
Adds
Immutable
primitive type -
Adds
Unitable
protocol and.from_success()
and.from_failure()
methods for allResult
realted classes -
Adds
Instanceable
protocol and.from_value()
method forIO
andRequiresContext
-
Adds
flow
function, which is similar topipe
-
Adds
swap
coverter forResult
andIOResult
-
Adds
squash_context
function to squashRequiresContext
similar toIO
- Now
Success
andFailure
(bothio
and pure) returnAny
and notNoReturn
- Fixes how
flatten
works, also adds more tests and docs aboutFailure
case - Fixes
Unwrappable
type being parametrized with only oneTypeVar
- Changes
Success
andFailure
to returnAny
instead ofNoReturn
- Updates
poetry
version intravis
- Imporves
pipe
docs withlambda
andGeneric
problem - Improves docs in several places
- Now examples in docs tries to be docstests where possible
- Changes how tests are checked with
mypy
in CI
- Breaking: now
@pipeline
requires a container type when created:@pipeline(Result)
or@pipeline(Maybe)
Maybe
andResult
now hassuccess_type
andfailure_type
aliases- Adds
Result.unify
utility method for better error type composition - We now support
dry-python/classes
as a first-class citizen - Adds
io_squash
to squash severalIO
containers into one container with a tuple inside, currently works with9
containers max at a time - Adds
untap
function which does convert return type toNone
- Fixes that containers were not usable with
multiprocessing
- Changes the inheritance order, now
BaseContainer
is the first child - Fixes that
Nothing
had incorrect docstrings
- Now
generated
package is protected - Updates
poetry
to1.0
- Breaking: now
pipe()
does not require argument to be the first value, instead it is required to use:pipe(f1, f2, f3, f4)(value)
- Breaking: dropped everything from
returns/__init__.py
, because we now have quite a lot of stuff - Breaking: dropped support of zero argument functions for
Nothing.fix
- Breaking: dropped support of zero argument functions for
Nothing.rescue
Maybe
now has.failure()
to match the same API asResult
- Adds
identity
function - Adds
tap
function - Now
pipe
allows to pipe 8 steps - Adds
coalesce_result
andcoalesce_maybe
coverters
- Fixes that code inside
.fix
and.rescue
ofMaybe
might be called twice
- Now all methods have doctests
- Updates docs about
Success
and_Success
,Failure
and_Failure
- Updates docs about
@pipeline
- Typechecks async functions and decorators inside
typesafety/
tests
- Breaking:
python>=3.7,<=3.7.2
are not supported anymore, because of a bug insidetyping
module - Breaking: Now
bind
does not change the type of an error - Breaking: Now
rescue
does not change the type of a value - Breaking: Renames
map_failure
toalt
- Adds
box()
function with the ability to box function for direct container composition like:a -> Container[b]
toContainer[a] -> Container[b]
- Adds
IO.lift()
function to lifta -> a
toIO[a] -> IO[a]
- Adds
pipe()
function topipeline.py
- Adds
__hash__()
magic methods to all containers
- Changes
Any
toNoReturn
inSuccess
andFailure
- Now all type parameters in
Result
,Maybe
, andIO
are covariant
- Massive docs rewrite
- Updates
mypy
version - Updates
wemake-python-styleguide
and introducesnitpick
- Updates
pytest-plugin-mypy
, all tests now useyml
- Provides a bunch of primitive interfaces to write your own containers
- Adds
.map_failure()
method - Adds
flatten()
function to join nested containers
- Fixes type of
Maybe.fix
andMaybe.rescue
to work with bothlambda: 1
andlambda _: 1
- Improves
README
- Reintroduces the
Maybe
container, typed! - Introduces converters from one type to another
- Adds
mypy
plugin to type decorators - Complete rewrite of
Result
types - Partial API change, now
Success
andFailure
are not types, but functions - New internal types introduced:
FixableContainer
andValueUnwrapContainer
- Fixes issue when you could return
IO
container fromResult.bind
- Fixes
@pipeline
return type
- Reapplied all types to
.py
files - Improved docs about
IO
andContainer
concept - Adds docs about container composition
- Moves from
Alpha
toBeta
- Adds
IO
marker - Adds
unsafe
module with unsafe functions - Changes how functions are located inside the project
- Fixes container type in
@pipeline
- Now
is_successful
is public - Now
raise_exception
is public
- Changes how
str()
function works for container types - Total rename to "container" in the source code
safe
andpipeline
now supportsasyncio
is_successful
now returnsLiteral
types if possible
- Adds
compose
helper function - Adds public API to
import returns
- Adds
raise_exception
helper function - Adds full traceback to
.unwrap()
- Updates multiple dev-dependencies, including
mypy
- Now search in the docs is working again
- Relicenses this project to
BSD
- Fixes copyright notice in the docs
- Moves all types to
.pyi
files - Renames all classes according to new naming pattern
- HUGE improvement of types
- Renames
fmap
tomap
- Renames
do_notation
topipeline
, moves it tofunctions.py
- Renames
ebind
torescue
- Renames
efmap
tofix
- Renames
container
toContainer
- Removes
Maybe
container, since typing does not haveNonNullable
type
- Adds
py.typed
file to bePEP561
compatible
The project is renamed to returns
and moved to dry-python
org.
- Adds
.pyi
files for all modules, to enablemypy
support for 3rd party users
- Adds
Maybe
container - Adds immutability and
__slots__
to all containers - Adds methods to work with failures
- Adds
safe
decorator to convert exceptions toResult
container - Adds
is_successful()
function to detect if your result is a success - Adds
failure()
method to unwrap values from failed containers
- Changes the type of
.bind
method forSuccess
container - Changes how equality works, so now
Failure(1) != Success(1)
- Changes how new instances created on unused methods
- Improves docs
- Changes how
PyPI
renders package's page
- Improves
README
with new badges and installation steps
Initial release. Featuring only Result
and do_notation
.