Mutaprim
Mutaprim is very simple package containing a single module: mutaprim. The module contain 5 "mutable primitive" types,
all inheriting from a base class called MutablePrimitive:
MutableBoolMutableIntMutableFloatMutableStrMutableBytes
An instance of any MutablePrimitive subclass will have the value property, as well as equivalent get and set
functions.
Here is a very simple demonstration:
from mutaprim import MutableInt
def increment(integer: MutableInt):
integer.value += 1
# `__init__` and `__str__`
mutable_int = MutableInt(0)
print(mutable_int) # 0
# `get` and `set`
mutable_int.set(10)
print(mutable_int.get()) # 10
# `value`
increment(mutable_int)
print(mutable_int.value) # 11
Metadata
Release files for mutaprim 0.1.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 | |
|---|---|---|---|
| mutaprim-0.1.0.tar.gz | 6.1 kB | Details |
Release files / mutaprim-0.1.0.tar.gz
| Download URL | mutaprim-0.1.0.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7a62d0bd00034ab8d5b827846cf4e724d0cde095a78a7e208bf7262f81ef2516
|
|
BLAKE2b-256 checksum How to use checksums |
1723e8da8c5bc31caf6105cb2da92ed6ed87eca984d35df61ed030ba95fd45f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.3
|