Skip to main content

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:

  • MutableBool
  • MutableInt
  • MutableFloat
  • MutableStr
  • MutableBytes

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)

Source distribution for mutaprim 0.1.0
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

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

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