Crates.io | mutuple |
lib.rs | mutuple |
version | 1.0.0 |
source | src |
created_at | 2024-04-11 02:40:52.463976 |
updated_at | 2024-04-11 02:40:52.463976 |
description | Replace items in Python's immutable tuples |
homepage | https://github.com/davvid/mutuple |
repository | https://github.com/davvid/mutuple |
max_upload_size | |
id | 1204315 |
size | 9,284 |
Replace items in Python's "immutable" tuples.
yolo
We use Rust's PyO3 crate to manipulate tuples directly using the Stable CPython API. Editing tuples can lead to issues but works in practice for limited use cases.
import mutuple
def test_mutable_tuple():
"""mutuple tuple demo"""
value = ('read-only', 'tuple')
mutuple.setitem(value, 0, 'mutable')
assert value == ('mutable', 'tuple')