immutables
immutables copied to clipboard
A high-performance immutable mapping type for Python.
This commit add supports for PEP 585 on Python 3.9+. This is useful for runtime introspection ( resolves #83 ). For example, on Python 3.9+: ```python >>> immutables.Map[str, int] immutables._map.Map[int,...
Currently I don't see a way of getting the key and value types from a map type. Ideally, the `Map.__class_getitem__` should return an object with `__origin__` set to `Map` and...
I like the trend of increasing functional programming data types for Python. Any plans for a list/vector?
if you do here it is: ```python from typing import Iterable import immutables # Design choices: # - Using a class to allow for typing # - The class has...
Ideally, I would like to be able to do ``` x = Map({'a': 2, 'c': 1}) y = x.update({'b': 3: 'c': 2) z = y - x # magic z...
I am wondering if this is by design or because it hasn't been useful up till now. My use-case is implementing a middleware type of cache. The cache subscribes to...
Very basic operations are timed and compared among several implementations. PS: your library is awesome!
Python 3.9 will add the merge (`|`) and update (`|=`) operator support for the built-in `dict` (PEP 584). We should consider adding the same support for `immutables.Map`.
We might want to consider making the same optimization for empty mappings that CPython does for the builtin immutable types `tuple` and `frozenset`: make the empty mapping a singleton. For...