maybedata
This is a package that implements a Maybe data type in Python that represents values that might or might not exist.
It is implemented as a class hierarchy with an abstract base class Maybe. This class is not constructible, but can be called to construct members of its subclasses, Just and Nothing.
All methods are documented, feel free to call help() on the classes!
Call Maybe(value) or Just(value) to create a value that is present.
Call Maybe() or Nothing() to create a missing value.
Check maybe.present to find out if a value is present.
Access maybe.value to get the value if it is present.
Call maybe.assume_present() to raise an exception if the value is not present.
Call maybe.get(default) to get the value or a default value.
Maybe and Just are generic classes if you use type hinting.
Just and Nothing support pattern matching.
Maybe, Just, and Nothing support len(), bool(), hash(), iter(), in, and ==.
The method maybe.alternatively() can be expressed using |.
The method maybe.then() can be expressed using >>.
Metadata
Release files for maybedata 0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| maybedata-0.8.tar.gz | 7.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| maybedata-0.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.8 kB
Release files / maybedata-0.8.tar.gz
| Download URL | maybedata-0.8.tar.gz |
|---|---|
| Size | 7.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
406a23dd10a02b24c2a143284bb1a82830570bb565c37fc45cd9021abdae0adf
|
|
BLAKE2b-256 checksum How to use checksums |
312af5bf0b108d48f363a908ec926452dc7b634f85020f3d20a4cd194b06ebb2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.28.1
|
Release files / maybedata-0.8-py3-none-any.whl
| Download URL | maybedata-0.8-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8dd49c748ff185a24255f203bfcee38bf2839b10a67487308b7a544b55231f05
|
|
BLAKE2b-256 checksum How to use checksums |
641f844ff83384bb9ce27f4f2e1c31881b45001df5013b77993f5ddb62fb5a16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.28.1
|