Skip to main content

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)

Source distribution for maybedata 0.8
File Size Uploaded
maybedata-0.8.tar.gz 7.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for maybedata 0.8
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.8 This release

2 release files

0.6

2 release files

0.5

2 release files

0.4

2 release files

0.3

2 release files

0.2

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page