Skip to content

Releases

v0.19.0

Choose a tag to compare

@github-actions github-actions released this 23 Oct 03:59
v0.19.0
987f178
  • [fixed] Lambdas passed to methods on a Result (for example
    result.map(lambda v: ...)) no longer have unknown parameter types on the
    Ok/Err side that ignores them, which strict checkers reported
    (pyright reportUnknownLambdaType, pyrefly implicit-any-lambda). Ignored
    op parameters are now typed Callable[[Never], object] | object, so the
    lambda's parameter is Never on that side (it disappears when joined with
    the real type) and Err("x").map(42) is still accepted

v0.18.0

Choose a tag to compare

@github-actions github-actions released this 20 Oct 15:17
v0.18.0
6121886

First release of the john-parton/result
fork of rustedpy/result, which is no longer maintained. It is not published to
PyPI; install it from the v0.18.0 tag (see the README). This release contains
breaking changes; the README has a migration guide.

  • [changed] Requires Python 3.12+ (upstream supported 3.8+); the code uses
    PEP 695 generics and the type statement
  • [changed] Ok and Err are frozen, slotted dataclasses. The value is a
    public field (ok_value / err_value), passed positionally only, and the
    private _value attribute is gone. repr() is now Ok(ok_value=1),
    equality requires the same class, and hash(Ok(x)) == hash(Err(x))
  • [changed] Result[T, E] is a type alias (Ok[T] | Err[E]) rather than a
    typing.Union, so it can no longer be passed to isinstance; use
    isinstance(r, (Ok, Err)) or OkErr
  • [removed] as_async_result and as_result. Use an explicit try/except
    returning Ok/Err instead (see the README)
  • [removed] Do notation (do(), do_async(), DoException) and the
    __iter__ methods on Ok and Err that supported it
  • [removed] is_ok() and is_err() type guard functions; use match or
    isinstance. The .is_ok() and .is_err() methods remain
  • [removed] The typing_extensions dependency, which was only needed for
    TypeIs; the package now has no runtime dependencies
  • [deprecated] .value remains deprecated (since 0.11.0); use .ok_value or
    .err_value
  • [added] Documentation built with Sphinx and published to GitHub Pages;
    result.__version__ is read from the package metadata
  • [changed] Development tooling: uv, ruff and pyrefly replace setuptools,
    tox, flake8 and mypy; the mypy plugin type tests are removed