Essential Rust Utilities in Python
Project description
oxypy
Fully-featured ports of several essential structs from Rust into pure Python
Since true privacy is impossible, inner values of the classes are designed to be quasi-private.
Methods
Some methods are deemed unnecessary due to the differences in the languages
Removed Methods:
- Copy and clone methods
- Ref and deref methods
- Unchecked methods
- Type-dependent methods
Reasons:
- Methods relating to references are useless due to lack of them in Python.
- Unchecked methods are unneccessary due to the lac of the unsafe system.
- Type dependent methods are practically impossible due to the dynamic type system.
Examples
Note: Type annotations are not always necessary, but are done here for brevity
Option
from oxypy import Option
some: Option[int] = Option.some(10)
none: Option[int] = Option.none()
Result
ok: Result[int, str] = Result.ok(10)
err: Result[int, str] = Result.err("An error occured")
Either
from oxypy import Either
left: Either[int, float] = Either.left(42)
right: Either[int, float] = Either.right(3.14159265)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file oxypy-1.0.1.tar.gz.
File metadata
- Download URL: oxypy-1.0.1.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a02240f1ae20fc2e2a8380b08c7deea65bc2e21a376468c5ec3c1ebef687715
|
|
| MD5 |
bf063bb0e5f3a67e7a01a07c787226e4
|
|
| BLAKE2b-256 |
e295fcf141a2083001f8f839db689e18e110fc623f38c6e84adbd97cc0d3170f
|
File details
Details for the file oxypy-1.0.1-py3-none-any.whl.
File metadata
- Download URL: oxypy-1.0.1-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1fa130f8f9734908a110f5fd8e3166a4698d0298243e213403b62901b4867192
|
|
| MD5 |
64de0fb2b6e3e526e97a2b436c395ae2
|
|
| BLAKE2b-256 |
e3823e6f31124f4d12ca78cad806e83452361833b70c942718fbfed6beae8f8c
|