Immutapy - Immutable data structures for Python
Immutapy is a library adding immutable data structures to Python to replace many of the standard library data structures. This is inspired by immutable.js and caused by mutable data structures generally just being a pain in the ass
Immutapy can be installed from pip. Supported (tested) versions of Python are 2.7, 3.4, 3.5 and 3.6, although most modern versions should be fine.
pip install immutapy
import immutable lst = immutable.List() new_list = lst.append(1) # >> lst == immutable.List() # True # >> new_list == immutable.List() # True
- ☐ Standard Library
- ☑ List (Somewhat)
- ☑ Dict
- ☐ Set
- ☐ collections
- ☐ numpy
Note that immutable structures tend to have a performance overhead. Differences are highlighted in the table below.
Trivia: Python's standard library uses arrays to back lists. See https://wiki.python.org/moin/TimeComplexity
## License [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Femman27%2Fimmutapy.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Femman27%2Fimmutapy?ref=badge_large)