diff mbox series

[bug#41807,02/26] gnu: Add python-immutables.

Message ID 20200611151357.18843-2-goodoldpaul@autistici.org
State Accepted
Headers show
Series [bug#41807,01/26] gnu: Add python-outcome. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job

Commit Message

Giacomo Leidi June 11, 2020, 3:13 p.m. UTC
* gnu/packages/python-xyz.scm (python-immutables): New variable.
---
 gnu/packages/python-xyz.scm | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 11630d4818..106a6802bd 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -20098,3 +20098,29 @@  For the most part it's transliterated from C, the major differences are:
 outcome of a Python function call, so that it can be passed around.")
     ;; Choice of either license.
     (license (list license:expat license:asl2.0))))
+
+(define-public python-immutables
+  (package
+    (name "python-immutables")
+    (version "0.14")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (pypi-uri "immutables" version))
+        (sha256
+          (base32
+            "0y0aqw29g525frdnmv9paljzacpp4s21sadfbca5b137iciwr8d0"))))
+    (build-system python-build-system)
+    (home-page
+      "https://github.com/MagicStack/immutables")
+    (synopsis "High-performance immutable mapping type for Python")
+    (description "@code{python-immutables} provides an immutable mapping
+type for Python.  The underlying datastructure is a Hash Array Mapped Trie
+(HAMT), and it's used in Clojure, Scala, Haskell, and other functional
+languages.  This implementation is used in CPython 3.7 in the contextvars module
+(see PEP 550 and PEP 567 for more details).
+
+Immutable mappings based on HAMT have O(log N) performance for both @code{set()}
+and @code{get()} operations, which is essentially O(1) for relatively
+small mappings.")
+    (license license:asl2.0)))