This project follows semantic versioning.
Possible log types:
[added]
for new features.[changed]
for changes in existing functionality.[deprecated]
for once-stable features removed in upcoming releases.[removed]
for deprecated features removed in this release.[fixed]
for any bug fixes.[security]
to invite users to upgrade in case of vulnerabilities.
-- [added]
is_ok
and is_err
type guard functions as alternatives to isinstance
checks (#69)
0.13.1 - 2023-07-19
[fixed]
Useself._value
instead of deprecatedself.value
inErr.expect
andErr.unwrap
to avoid raising a warning (#133)
0.13.0 - 2023-07-15
[changed]
Include capturedErr
value whenexpect
andunwrap
are called and anUnwrapError
is raised (#98, #132)
0.12.0 - 2023-06-11
[removed]
Drop support for Python 3.7 (#126)[fixed]
Pattern matching deprecation warning (#128)[changed]
Minor internal implementation details (#129, #130)
0.11.0 - 2023-06-11
[changed]
Ok
now requires an explicit value during instantiation. Please check out MIGRATING.md, it will guide you through the necessary change in your codebase.[deprecated]
value
property to access the inner value (#37, #121)[added]
ok_value
anderr_value
to access the inner value more safely (#37, #121)
0.10.0 - 2023-04-29
[fixed]
Make python version check PEP 484 compliant (#118)[added]
as_async_result
decorator to turn regular async functions intoResult
returning ones (#116)
0.9.0 - 2022-12-09
[added]
Implementunwrap_or_raise
(#95)[added]
Add support for Python 3.11 (#107)[changed]
Narrowing of return types on methods ofErr
andOk
. (#106)[fixed]
Fix failing type inference forResult.map
and similar method unions (#106)
0.8.0 - 2022-04-17
[added]
as_result
decorator to turn regular functions intoResult
returning ones (#33, 71)[removed]
Drop support for Python 3.6 (#49)[added]
Implementunwrap_or_else
(#74),and_then
(#90) andor_else
(#90)
0.7.0 - 2021-11-19
[removed]
Drop support for Python 3.5 (#34)[added]
Add support for Python 3.9 and 3.10 (#50)[changed]
Make theOk
type covariant in regard to its wrapped typeT
. Likewise forErr
in regard toE
. This should result in more intuitive type checking behaviour. For instance,Err[TypeError]
will get recognized as a subtype ofErr[Exception]
by type checkers. See PEP 438 for a detailed explanation of covariance and its implications.[added]
Add support for Python 3.10 pattern matching (#47)[changed]
Ok
andErr
now define__slots__
to save memory (#55, #58)[changed]
The generic type ofUnwrapError.result
now explicitly specifiesAny
(#67)
0.6.0 - 2021-03-17
IMPORTANT: This release a big API refactoring to make the API more type safe. Unfortunately this means some breaking changes. Please check out MIGRATING.md, it will guide you through the necessary changes in your codebase.
- [changed] Split result type into
Ok
andErr
classes (#17, #27) - [deprecated] Python 3.4 support is deprecated and will be removed in the next release
0.5.0 - 2020-03-03
- [added] Implement
map
,map_err
,map_or
andmap_or_else
(#19) - [added] Add
unwrap_err
andexpect_err
methods (#26) - [changed] Type annotations: Change parameter order
from
Result[E, T]
toResult[T, E]
to match Rust/OCaml/F# (#7)
0.4.1 - 2020-02-17
- [added] Add
py.typed
for PEP561 package compliance (#16)
0.4.0 - 2019-04-17
- [added] Add
unwrap
,unwrap_or
andexpect
(#9) - [removed] Drop support for Python 2 and 3.3
- [changed] Only install typing dependency for Python <3.5
0.3.0 - 2017-07-12
- [added] This library is now fully type annotated (#4, thanks @tyehle)
- [added] Implementations for
__ne__
,__hash__
and__repr__
- [deprecated] Python 2 support is deprecated and will be removed in the 0.4 release
0.2.2 - 2016-09-21
- [added]
__eq__
magic method
0.2.0 - 2016-05-05
- [added] Convenience default:
Ok()
==Ok(True)
0.1.1 - 2015-12-14
- [fixed] Import bugfix
0.1.0 - 2015-12-14
- Initial version