returns v0.14.0 Release Notes
Release Date: 2020-06-07 // almost 4 years ago-
Special thanks to:
- @orsinium
- @thedrow
- @thepabloaguilar
- and other (code and ideas) contributors
๐ for making this release possible. You are awesome!
Announcement: https://sobolevn.me/2020/06/how-async-should-have-been
๐ Features
๐ฅ Breaking : renames mypy plugin from
decorator_plugin
toreturns_plugin
because of a complete rewrite and lots of new features๐ฅ Breaking : changes
@safe
,@impure
,impure_safe
,@maybe
semantics:
they do not work withasync
functions anymore;
now you are forced to useFuture
and its helpers
to work withasync
functions๐ฅ Breaking : renames
Maybe.new
toMaybe.from_value
.
๐ Because all our other containers support this protocol.
OnlyMaybe
was different, sorry for that!๐ฅ Breaking : renames
.from_success()
to.from_value()
,
there's no need in two separate methods๐ฅ Breaking : renames
.from_successful_io()
to.from_io()
,
there's no need in two separate methods๐ฅ Breaking : renames
.from_successful_context()
to.from_context()
,
there's no need in two separate methods๐ฅ Breaking : since we now support
.apply()
method,
๐ there's no more need in*_squash
converters, they are removed๐ฅ Breaking : renamed
Instanceable
toApplicative
๐ฅ Breaking : changes
.from_io
and.from_failed_io
ofIOResult
to returnAny
instead ofNoReturn
unfilled type๐ฅ Breaking : removes
.lift
and.lift_*
methods from all containers,
usemap_
,bind_result
,bind_io
, and other pointfree helpers instead๐ฅ Breaking : removes
@pipeline
function. It was a mistake:
it does not work with mixed container types,
it does not type failures properly,
it does not work withIO
andFuture
,
it enforces to write imperative code in a functional codebase.
๐ Useflow
insteadโ Adds typed
partial
andcurry
mypy plugins!โ Adds typed
flow
plugin, now it can accept any number of arguments,
it now also has excelent type inferenceโ Adds typed
pipe
plugin, now it can accept any number of arguments,
it now also has good type inferenceโ Adds
managed
pipeline function that is useful
for working with stateful computationsโ Adds typed
map_
,fix
, andalt
pointfree functionsAdds typed
bind_result
,bind_io
,bind_ioresult
,
bind_context
,bind_context_result
,bind_future
,
bind_async
, andbind_awaitable
pointfree functionsAdds typed
bind_async_future
andbind_async_future_result
pointfree functionsโ Adds typed
unify
pointfree functionโ Adds typed
apply
pointfree functionโ Adds typed
value_or
pointfree functionโ Adds
pytest
plugin with the ability to tests error handlingโ Adds
Future
container to easily work withasync
functionsโ Adds
FutureResult
container to easily work
withasync
function that might failโ Adds
RequiresContextFutureResult
containerโ Adds
ReaderFutureResult
alias forRequiresContextFutureResult
โ Adds
RequiresContextFutureResultE
andReaderFutureResultE
aliasesโ Adds
Future
,FutureResult
andRequiresContextFutureResult
๐ support for all existing pointfree functionsโ Adds
bind_io
method toIOResult
โ Adds
bind_io
method toRequiresContextIOResult
โ Adds
or_else
method toMaybe
Adds
.from_io
and.from_failed_io
toRequiresContextIOResult
Syncs naming in
from_*
methods, now all parameters are namedinner_value
โ Adds
not_
composition helperโ Adds
flatten
support forFuture
,
FutureResult
andRequiresContextFutureResult
Adds
__copy__
and__deepcopy__
magic methods toImmutable
classSpeeds up
is_successful
function๐ Makes all
Context
context helpers abstract,
so you cannot create new instances of this class,
also adds__slots__
to these classes๐ Improves
RequiresContext*
types withNoDeps
where it is logically true๐ Bugfixes
- ๐ Fixes that
@safe
decorator was generating incorrect signatures
for functions withAny
- ๐ Fixes that
.rescue()
ofRequiresContextResult
was returningAny
- ๐ Fixes that
.rescue()
ofRequiresContextIOResult
was returningAny
- ๐ Fixes that
RequiresContextResult
andRequiresContextIOResult
were notfinal
- ๐ Fixes that
ImmutableStateError
was not a subclass ofAttributeError
- ๐ Fixes that
IOResult
was not showingstr
representation
of wrappedinner_value
Misc
- โ
Replaces
pytest-asyncio
withanyio
plugin,
โ now we test compatibility with any IO stack:asyncio
,trio
,curio
- โก๏ธ Updates lots of dependencies
- โ Adds lots of new tests
- โก๏ธ Updates lots of docs
- โ Removes "IO marker" name from docs in favor for "IO container",
it is not special at all. Why would we call it differently?