python-pyrsistent
Port variant py39
Summary Persistent, Immutable data structures (3.9)
Package version 0.19.2
Homepage https://github.com/tobgu/pyrsistent/
Keywords python
Maintainer Python Automaton
License Not yet specified
Other variants py310
Ravenports Buildsheet | History
Ravensource Port Directory | History
Last modified 03 NOV 2022, 02:27:34 UTC
Port created 08 AUG 2020, 00:24:11 UTC
Subpackage Descriptions
single Pyrsistent ========== .. _Pyrthon: https://www.github.com/tobgu/pyrthon/ Pyrsistent is a number of persistent collections (by some referred to as functional data structures). Persistent in the sense that they are immutable. All methods on a data structure that would normally mutate it instead return a new copy of the structure containing the requested updates. The original structure is left untouched. This will simplify the reasoning about what a program does since no hidden side effects ever can take place to these data structures. You can rest assured that the object you hold a reference to will remain the same throughout its lifetime and need not worry that somewhere five stack levels below you in the darkest corner of your application someone has decided to remove that element that you expected to be there. Pyrsistent is influenced by persistent data structures such as those found in the standard library of Clojure. The data structures are designed to share common elements through path copying. It aims at taking these concepts and make them as pythonic as possible so that they can be easily integrated into any python program without hassle. If you want use literal syntax to define them in your code rather than function calls check out Pyrthon_. Be aware, that one is experimental, unmaintained and alpha software. Examples -------- .. _Sequence: collections_ .. _Hashable: collections_ .. _Mapping: collections_ .. _Mappings: collections_ .. _Set: collections_ .. _collections: https://docs.python.org/3/library/collections.abc.html .. _documentation: http://pyrsistent.readthedocs.org/ The collection types and key features currently implemented are: * PVector_, similar to a python list * PMap_, similar to dict * PSet_, similar to set * PRecord_, a PMap on steroids with fixed fields, optional type and invariant checking and much more * PClass_, a Python class fixed fields, optional type and invariant checking and much more * `Checked collections`_, PVector, PMap and PSet with optional type and invariance checks and more * PBag, similar to collections.Counter * PList, a classic singly linked list * PDeque, similar to collections.deque * Immutable object type (immutable) built on the named tuple * freeze_ and thaw_ functions to convert between pythons standard collections and pyrsistent collections. * Flexible transformations_ of arbitrarily complex structures built from PMaps and PVectors. Below are examples of common usage patterns for some of the structures and features. More information and full documentation for all data structures is available in the documentation_. .. _PVector: PVector ~~~~~~~ With full support for the Sequence_ protocol PVector is meant as a drop in replacement to the built in list from a readers point of view. Write operations of course differ since no in place mutation is done but naming should be in line with corresponding operations on the built in list. Support for the Hashable_ protocol also means that it can be used as key in Mappings_. Appends are amortized O(1). Random access and insert is log32(n) where n is the size of the vector. .. code:: python >>> from pyrsistent import v, pvector # No mutation of vectors once created, instead they # are "evolved" leaving the original untouched >>> v1 = v(1, 2, 3) >>> v2 = v1.append(4) >>> v3 = v2.set(1, 5) >>> v1 pvector([1, 2, 3]) >>> v2 pvector([1, 2, 3, 4]) >>> v3 pvector([1, 5, 3, 4]) # Random access and slicing
Configuration Switches (platform-specific settings discarded)
PY310 OFF Build using Python 3.10 PY39 ON Build using Python 3.9
Package Dependencies by Type
Build (only) python-pip:single:py39
autoselect-python:single:standard
Build and Runtime python39:single:standard
Download groups
main mirror://PYPIWHL/54/d3/986fcfeaf62047840c571a857fb8f3ad1e9622081d5e7d0ee5e3451ca2e7
Distribution File Information
ea6b79a02a28550c98b6ca9c35b9f492beaa54d7c5c9e9949555893c8a9234d0 57455 pyrsistent-0.19.2-py3-none-any.whl
Ports that require python-pyrsistent:py39
python-jsonschema:py39 Alternate implementation of JSON Schema (3.9)