opt4py
Adds to Python an Option container class that handles seamlessly NoneType checks in a monadic way. Similar to Option
in Rust or Optional in Java, but it also overloads every operator for a smooth use without worries.
Usage
>>> from opt4py import Option
>>> Option(1)
Option(1)
>>> Option("Hello World!")
Option(Hello World!)
>>> Option()
Option(None)
>>> Option(1) + 1
Option(2)
>>> Option(2) * Option(2)
Option(4)
>>> Option(5).unwrap()
5
>>> Option(8).map(lambda x: x*2)
Option(16)
>>> Option(2) == 2
True
>>> Option(2) > 3
False
Metadata
Release files for opt4py 1.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 |
|---|---|---|---|---|
| opt4py-1.0.0.tar.gz | 3.4 kB | Without provenance | Details for opt4py-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| opt4py-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for opt4py-1.0.0-py3-none-any.whl |
Total release size: 7.7 kB
Release files / opt4py-1.0.0.tar.gz
| Download URL | opt4py-1.0.0.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d970699d9bb0e9687e54af01b3cd550df5c473136d78cfdac436fdaa17ff95bc
|
|
BLAKE2b-256 checksum How to use checksums |
d2f9cb04e1214281d2880d495245d7cded7653e69b5d95d703fecb17ad707f70
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Release files / opt4py-1.0.0-py3-none-any.whl
| Download URL | opt4py-1.0.0-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
884b868bd0c168bc513553ebdbff392dd8048abea5612a94691d4dd31d25cc8c
|
|
BLAKE2b-256 checksum How to use checksums |
a66bbfbdd31695aa7e15591f4702a0c0998bc1dbaee18c4ffd3cf02f723e8be8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Security for opt4py 1.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.