Maybe
A simple Maybe (Option) type for Python 3 inspired by Rust, fully type annotated.
Installation
Not yet available on PyPI. PyPI package coming soon.
Latest GitHub master branch version:
$ pip install git+https://github.com/rustedpy/maybe
Summary
Experimental. API subject to change.
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.
Example usage,
from rustedpy-maybe import Nothing, Some
o = Some('yay')
n = Nothing()
assert o.unwrap_or_else(str.upper) == 'yay'
assert n.unwrap_or_else(lambda: 'default') == 'default'
License
MIT License
Metadata
Release files for rustedpy-maybe 0.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rustedpy-maybe-0.0.0.tar.gz | 7.0 kB | Without provenance | Details for rustedpy-maybe-0.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rustedpy_maybe-0.0.0-py3-none-any.whl | Python 3 | none | any | Details for rustedpy_maybe-0.0.0-py3-none-any.whl |
Total release size: 12.5 kB
Release files / rustedpy-maybe-0.0.0.tar.gz
| Download URL | rustedpy-maybe-0.0.0.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7737f67186a74ea50db4e2511f1238560047b38a61c5e49b7f7e755b31a6aace
|
|
BLAKE2b-256 checksum How to use checksums |
87be64ecd947c8a6016073c8748a5a4a828b45bda5b8887ed7b057c0771f455d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / rustedpy_maybe-0.0.0-py3-none-any.whl
| Download URL | rustedpy_maybe-0.0.0-py3-none-any.whl |
|---|---|
| Size | 5.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0808636203133c69c1573f8b07c0375dd72b6ab1e5f32ef3ed42295ee63d93d3
|
|
BLAKE2b-256 checksum How to use checksums |
80d880df2f0a2532216550272b8f58b47554e244efe195869a3071b2f7c42094
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Security for rustedpy-maybe 0.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.