You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A simple Maybe (Option) type for Python 3 inspired by Rust, fully type annotated.
Installation
Latest release:
pip install rustedpy-maybe
Latest GitHub master branch version:
pip install git+https://github.com/rustedpy/maybe
There are no dependencies outside of the Python standard library. However, if
you wish to use the Result conversion methods (see examples in the next
section), you will need to install the result extra.
In this case, rather than installing via one of the commands above, you can
install the package with the result extra either from the latest release:
The idea is that a possible value can be either Some(value) or Nothing(),
with a way to differentiate between the two. Some and Nothing are both
classes encapsulating a possible value.
There are some methods that support conversion from a Maybe to a Result type
in the result library. If you wish to
leverage these methods, you must install the result extra as described in the
installation section.
These steps should work on any Unix-based system (Linux, macOS, etc) with Python
and make installed. On Windows, you will need to refer to the Python
documentation (linked below) and reference the Makefile for commands to run
from the non-unix shell you're using on Windows.
Setup and activate a virtual environment. See Python docs for
more information about virtual environments and setup.