[tahoe-lafs-trac-stream] [Tahoe-LAFS] #2373: adopt pyrsistent
Tahoe-LAFS
trac at tahoe-lafs.org
Thu Feb 5 17:11:12 UTC 2015
#2373: adopt pyrsistent
-----------------------------+-----------------------
Reporter: zooko | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: undecided
Component: unknown | Version: 1.10.0
Resolution: | Keywords:
Launchpad Bug: |
-----------------------------+-----------------------
Comment (by daira):
+1 for the basic idea: I like persistent data structures and they're
essentially as expressive as mutable ones, while being less error-prone.
+1 for pyrsistent's API which appears, on a cursory reading, to be well-
thought-out and reasonably complete. I particularly like the PRecord
abstraction which we could make good use of in many places.
+0.3 for pyrsistent's unit test suite. This is not a full +1 because the
tests, although they cover the external interfaces reasonably well, are
only "black-box" tests that do not attempt to check the internal
representations of the persistent structures or to exercise any hard
cases. In particular, they typically only test structures with a small
number of elements, which does not properly cover all of the
implementation, because most of the structures are based on trees with an
arity of 32.
-1 because pyrsistent has a C extension which is optionally used. This
potentially introduces build problems if the build process has a problem
compiling the extension and fails to correctly fall back to the pure-
Python code.
Note that I don't think we use frozenset and tuples in all the places we
could. Where possible, it is better to use a truly immutable data
structure rather than a persistent data structure, both for efficiency and
understandability.
--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2373#comment:1>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list