returns changelog

Make your functions return something meaningful, typed, and safe!

All Versions
23
Latest Version
Avg Release Cycle
57 days
Latest Release
-

Changelog History
Page 1

  • v0.19.1 Changes

    πŸ›  Bugfixes

    • πŸ›  Fixes a problem with do-notation and type aliases
    • πŸ›  Fixes custom pickle protocol to handle None values gracefully
    • βœ‚ Removes broken drylabs.io link in README
    • πŸ“š Revises pointfree documentation
  • v0.19.0 Changes

    πŸ”‹ Features

    • βž• Adds do notation
    • βž• Adds attempt decorator

    Misc

    • Check __slots__ correctness with slotscheck
  • v0.18.0 Changes

    πŸ†• New Year Release! πŸŽ„

    πŸ”‹ Features

    • Now requires typing_extensions>=4.0
    • Now requires mypy>=0.930
    • βœ‚ Removes plugin for @safe, @maybe, @future, etc. Because we now use ParamSpec type to properly type decorators

    πŸ›  Bugfixes

    • Fixes __slots__ not being set properly in containers and their base classes
    • πŸ›  Fixes patching of containers in pytest plugin not undone after each test
  • v0.17.1 Changes

    πŸ›  Bugfixes

    • Fixes __slots__ not being set properly in containers and their base classes
    • πŸ›  Fixes patching of containers in pytest plugin not undone after each test
  • v0.17.0 Changes

    πŸ”‹ Features

    • πŸ‘ Enables Pattern Matching support for Result containers
    • πŸ‘ Enables Pattern Matching support for Maybe container
    • πŸ‘ Enables Pattern Matching support for IOResult container
    • πŸ‘Œ Improves hypothesis plugin, now we detect when type cannot be constructed and give a clear error message
    • βž• Adds the option to pass what exceptions @safe will handle
  • v0.16.0 Changes

    πŸ”‹ Features

    • πŸ‘‰ Makes _Nothing a singleton
    • πŸ”¨ Refactor flow function to be faster

    πŸ›  Bugfixes

    • πŸ›  Fixes that assert_trace was not catching containers from @safe-wrapped functions

    Misc

    • πŸ›  Fixes typos in documentation
  • v0.15.0 Changes

    October 21, 2020

    πŸ”‹ Features

    βž• Adds Higher Kinded Types partial support

    πŸ’₯ Breaking : drops python3.6 support

    πŸ’₯ Breaking : makes our mypy plugin not optional, but required!

    πŸ’₯ Breaking : changes all RequiresContext-based type arguments order,
    previously we used to specify _EnvType as the first type argument,
    now it is the last one. This is done to respect new HKT rules

    πŸ’₯ Breaking : renames .rescue to .lash

    πŸ’₯ Breaking : removes all old interfaces from primitives/interfaces.py,
    πŸ‘‰ use new typeclasses instead

    πŸ’₯ Breaking : Maybe is fully reworked to be lawful

    πŸ’₯ Breaking : removes value_or pointfree method,
    because it is impossible to express with HKT

    πŸ’₯ Breaking : removes .value_or, .unwrap, and .failure methods
    from FutureResult and RequiresContext-based types,
    πŸ‘» because we do require these methods to raise an exception on failure,
    πŸ‘» but these methods were lazy and did not raise the required exception

    πŸ’₯ Breaking : changes how is_successful is typed:
    now we allow any Unwrappable interface instances there,
    including custom ones

    πŸ’₯ Breaking : changes UnwrapFailedError constructor,
    now it does accept an Unwrappable instance instead of a BaseContainer

    πŸ’₯ Breaking : removes .fix method from all containers,
    🚚 also removes fix pointfree function

    πŸ’₯ Breaking : Removes coalesce function,
    because it is impossible to properly type it

    πŸ’₯ Breaking : Removes all Context* based types with .ask() method,
    πŸ‘‰ use new .ask() methods on the Reader-based containers

    πŸ’₯ Breaking : Now Future and FutureResult can be awaited multiple times

    πŸ’₯ Breaking : Removes .unify() method from several containers,
    πŸ‘‰ use unify() pointfree function instead

    πŸ’₯ Breaking : Removes .from_iterable method from all containers,
    πŸ‘ instead adds better iterables support,
    we now have returns.iterables module with Fold helper

    πŸ’₯ Breaking : Renames property empty to no_args of
    all RequiresContext-based classes

    βž• Adds new public interfaces: see returns.interfaces

    βž• Adds methods package with several helpful things inside

    βž• Adds FutureSuccess and FutureFailure unit functions
    to be similar to Result and IOResult

    βž• Adds .swap method to Result, IOResult, FutureResult,
    and other result based containers

    Adds .modify_env method to all RequiresContext* types

    βž• Adds .rescue to Maybe

    βž• Adds .equals methods to types that can be compared directly:
    Result, Maybe, IO, IOResult

    Adds missing from_requires_context_future_result to RequiresContext

    Adds .from_optional and .bind_optional to Maybe container

    Adds __slots__ to UnwrapFailedError with halted_container

    πŸ”„ Changes flatten to work with KindN and any possible container

    βž• Adds a helper to test traces to our pytest plugin

    βž• Adds cond function to pointfree and methods packages

    βž• Adds compose_result HKT method and pointfree function

    βž• Adds unify HKT pointfree function

    βž• Adds bimap pointfree function

    Adds unwrap_or_failure function to methods package

    βž• Adds collect_trace helper function for better development experience

    βž• Adds hypothesis intergration and pre-defined "monad laws as values"

    βž• Adds assert_equal method to our pytest plugin

    πŸ›  Bugfixes

    • πŸ’₯ Breaking : fixes serious typing issue and changes how flow works
    • πŸ’₯ Breaking : fixes serious typing issue and changes how pipe works,
      now it has a hard limit of 20 parameters
    • πŸ›  Fixes that RequiresContextFutureResult was not supported by pytest plugin
    • πŸ›  Fixes incorrect partial behaviour in an edge case, #618
    • πŸ›  Fixes that .apply method of IOResult was working incorrectly,
      it was returning IOFailure(2)
      as a result of IOFailure(1).apply(IOFailure(2))
    • πŸ›  Fixes bug that safe(tap(...)) was revealing invalid types sometimes

    Misc

    • βž• Adds a lot of new typetests
    • Checks that now all math laws are checked for all types
    • πŸ”„ Changes docs structure, adds new Interfaces, HKT, and Methods pages
    • Changed __str__ method in BaseContainer class to __repr__ method
    • βž• Adds Quickstart guide
  • v0.14.0 Changes

    June 07, 2020

    Special thanks to:

    Announcement: https://sobolevn.me/2020/06/how-async-should-have-been

    πŸ”‹ Features

    πŸ’₯ Breaking : renames mypy plugin from decorator_plugin to returns_plugin
    because of a complete rewrite and lots of new features

    πŸ’₯ Breaking : changes @safe, @impure, impure_safe, @maybe semantics:
    they do not work with async functions anymore;
    now you are forced to use Future and its helpers
    to work with async functions

    πŸ’₯ Breaking : renames Maybe.new to Maybe.from_value.
    πŸ‘ Because all our other containers support this protocol.
    Only Maybe 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 to Applicative

    πŸ’₯ Breaking : changes .from_io and .from_failed_io of IOResult
    to return Any instead of NoReturn unfilled type

    πŸ’₯ Breaking : removes .lift and .lift_* methods from all containers,
    use map_, 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 with IO and Future,
    it enforces to write imperative code in a functional codebase.
    πŸ‘‰ Use flow instead

    βž• Adds typed partial and curry 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, and alt pointfree functions

    Adds typed bind_result, bind_io, bind_ioresult,
    bind_context, bind_context_result, bind_future,
    bind_async, and bind_awaitable pointfree functions

    Adds typed bind_async_future and bind_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 with async functions

    βž• Adds FutureResult container to easily work
    with async function that might fail

    βž• Adds RequiresContextFutureResult container

    βž• Adds ReaderFutureResult alias for RequiresContextFutureResult

    βž• Adds RequiresContextFutureResultE and ReaderFutureResultE aliases

    βž• Adds Future, FutureResult and RequiresContextFutureResult
    πŸ‘Œ support for all existing pointfree functions

    βž• Adds bind_io method to IOResult

    βž• Adds bind_io method to RequiresContextIOResult

    βž• Adds or_else method to Maybe

    Adds .from_io and .from_failed_io to RequiresContextIOResult

    Syncs naming in from_* methods, now all parameters are named inner_value

    βž• Adds not_ composition helper

    βž• Adds flatten support for Future,
    FutureResult and RequiresContextFutureResult

    Adds __copy__ and __deepcopy__ magic methods to Immutable class

    Speeds 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 with NoDeps where it is logically true

    πŸ›  Bugfixes

    • πŸ›  Fixes that @safe decorator was generating incorrect signatures
      for functions with Any
    • πŸ›  Fixes that .rescue() of RequiresContextResult was returning Any
    • πŸ›  Fixes that .rescue() of RequiresContextIOResult was returning Any
    • πŸ›  Fixes that RequiresContextResult and RequiresContextIOResult
      were not final
    • πŸ›  Fixes that ImmutableStateError was not a subclass of AttributeError
    • πŸ›  Fixes that IOResult was not showing str representation
      of wrapped inner_value

    Misc

    • βœ… Replaces pytest-asyncio with anyio 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?
  • v0.13.0 Changes

    February 02, 2020

    Announcing article: https://sobolevn.me/2020/02/typed-functional-dependency-injection

    πŸ”‹ Features

    πŸ’₯ Breaking : renames join to flatten, sorry!

    πŸ’₯ Breaking : renames box to bind and moves it to returns.pointfree

    πŸ’₯ Breaking : removes Maybe.rescue and Maybe.fix methods

    πŸ’₯ Breaking : renames io_squash to squash_io
    🚚 and moves it to returns.converters

    πŸ’₯ Breaking : moves all interfaces from returns.primitives.container to
    returns.primitives.interfaces

    βž• Adds rescue pointfree function

    βž• Adds ResultE alias for Result[..., Exception]

    βž• Adds RequiresContext container and Context helper class

    βž• Adds RequiresContext support for bind pointfree function

    βž• Adds RequiresContext support for flatten function

    βž• Adds RequiresContextResult container

    βž• Adds RequiresContextResultE alias

    βž• Adds ReaderResult and ReaderResultE aliases
    πŸ‘» for RequiresContextResult[..., ..., Exception]

    βž• Adds RequiresContextResult support for bind and rescue

    βž• Adds RequiresContextResult support for flatten

    βž• Adds IOResult helper to work better with IO[Result[a, b]]

    βž• Adds IOResultE alias for IOResult[a, Exception]

    βž• Adds IOResult support for bind

    βž• Adds IOResult support for flatten

    βž• Adds IOResult support for @pipeline

    βž• Adds IOResult support for coalesce

    βž• Adds IOResult support for is_successful

    βž• Adds RequiresContextIOResult container

    βž• Adds RequiresContextIOResultE alias

    βž• Adds ReaderIOResult and ReaderIOResultE aliases
    πŸ‘» for RequiresContextIOResult[..., ..., Exception]

    βž• Adds RequiresContextIOResult support for bind and rescue

    βž• Adds RequiresContextIOResult support for flatten

    βž• Adds Result.lift, Maybe.lift, RequiresContext.lift,
    and RequiresContextResult.lift functions in addition to IO.lift

    βž• Adds Immutable primitive type

    Adds Unitable protocol and .from_success() and .from_failure()
    methods for all Result realted classes

    βž• Adds Instanceable protocol and .from_value() method
    for IO and RequiresContext

    βž• Adds flow function, which is similar to pipe

    βž• Adds swap coverter for Result and IOResult

    βž• Adds squash_context function to squash RequiresContext similar to IO

    πŸ›  Bugfixes

    • Now Success and Failure (both io and pure) return Any and not NoReturn
    • πŸ›  Fixes how flatten works, also adds more tests and docs about Failure case
    • πŸ›  Fixes Unwrappable type being parametrized with only one TypeVar
    • πŸ”„ Changes Success and Failure to return Any instead of NoReturn

    Misc

    • ⚑️ Updates poetry version in travis
    • πŸ“„ Imporves pipe docs with lambda and Generic 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
  • v0.12.0 Changes

    December 21, 2019

    πŸ”‹ Features

    • πŸ’₯ Breaking : now @pipeline requires a container type when created:
      @pipeline(Result) or @pipeline(Maybe)
    • Maybe and Result now has success_type and failure_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 several IO containers into one container
      with a tuple inside, currently works with 9 containers max at a time
    • βž• Adds untap function which does convert return type to None

    πŸ›  Bugfixes

    • πŸ›  Fixes that containers were not usable with multiprocessing
    • πŸ”„ Changes the inheritance order, now BaseContainer is the first child
    • πŸ›  Fixes that Nothing had incorrect docstrings

    Misc

    • πŸ“¦ Now generated package is protected
    • ⚑️ Updates poetry to 1.0
Awesome Python is part of the LibHunt network. Terms. Privacy Policy.

(CC)
BY-SA
We recommend Spin The Wheel Of Names for a cryptographically secure random name picker.

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /