Extra data structures for pyrsistent
Project description
Extra data structures for pyrsistent
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.
PSequence
Persistent sequences implemented with finger trees, with \(O(\log{n})\) merge/split/lookup and \(O(1)\) access at both ends.
>>> from pyrsistent_extras import psequence
>>> seq1 = psequence([1, 2, 3])
>>> seq1
psequence([1, 2, 3])
>>> seq2 = seq1.append(4)
>>> seq2
psequence([1, 2, 3, 4])
>>> seq3 = seq1 + seq2
>>> seq3
psequence([1, 2, 3, 1, 2, 3, 4])
>>> seq1
psequence([1, 2, 3])
>>> seq3[3]
1
>>> seq3[2:5]
psequence([3, 1, 2])
>>> seq1.set(1, 99)
psequence([1, 99, 3])
PHeap
Persistent heaps implemented with binomial heaps, with \(O(1)\) findMin/insert and \(O(\log{n})\) merge/deleteMin. Comes in two flavors: PMinHeap and PMaxHeap.
>>> from pyrsistent_extras import pminheap
>>> heap1 = pminheap([(1,'a'), (2,'b')])
>>> heap1
pminheap([(1, 'a'), (2, 'b')])
>>> heap2 = heap1.push(3,'c')
>>> heap2
pminheap([(1, 'a'), (2, 'b'), (3, 'c')])
>>> heap3 = heap1 + heap2
>>> heap3
pminheap([(1, 'a'), (1, 'a'), (2, 'b'), (2, 'b'), (3, 'c')])
>>> key, value, heap4 = heap3.pop()
>>> (key, value)
(1, 'a')
>>> heap4
pminheap([(1, 'a'), (2, 'b'), (2, 'b'), (3, 'c')])
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyrsistent-extras-0.1.1.tar.gz
(49.2 kB
view hashes)
Built Distributions
Close
Hashes for pyrsistent_extras-0.1.1-cp312-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cd42d6e17b81ae1ac463661149ca1eab0df9cdc548bf2f633a9dcb6e2d69812 |
|
MD5 | 3a25d324722ae6a0b9ece2fba954b2f9 |
|
BLAKE2b-256 | fec37acdd1dea73b2ef5c6533f2ab9d7b500d693232830c2d5d8fe9578a2a328 |
Close
Hashes for pyrsistent_extras-0.1.1-cp312-abi3-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 725cbafbf38dfe26a6d3128bd2ded7f78218df143c4ea6b013bb224883fb9b22 |
|
MD5 | 321bcf181447bca8faba289c4546bcd3 |
|
BLAKE2b-256 | 74e1c68316883252c622273ae9a69ef0072a276b950e56f2ab1e81e941771445 |
Close
Hashes for pyrsistent_extras-0.1.1-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef9318763685f62914230d81b8498fdc3540cf271a67d91d56d517f75a77e04c |
|
MD5 | e88bed09a0e40addb42e5edfb47e27aa |
|
BLAKE2b-256 | 0e7f5f8ff3cdd3ca86a0d5ff06366c7add770292660840bd681611d1e8027f9e |
Close
Hashes for pyrsistent_extras-0.1.1-cp312-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81600ba12b4bf85ff256a119b1364e4ad21d3ec9482bd57fa17d2f906647b415 |
|
MD5 | d018504deb91341a3ff3db186f296ce5 |
|
BLAKE2b-256 | 1cbc7608bb9d6e813c553a13fdda5232b6f4ccf740db86639633c635492ea243 |
Close
Hashes for pyrsistent_extras-0.1.1-cp312-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25922282b3baac30feee653b6ca46fe1c0a1310d6a256fe4a85ba17bc6179c94 |
|
MD5 | 9da6d9e76bd5aa3296e0263196859c33 |
|
BLAKE2b-256 | 3c96c192d56c71126a6f8fc78299a71600eaaacc130f6c6d5c3bebdaab061922 |
Close
Hashes for pyrsistent_extras-0.1.1-cp312-abi3-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d66c50efe947b5b9b8f8055c70c8da10af1f36770f89b5589d154c501d832d36 |
|
MD5 | f532a599d8b975916733eff1a281a8f3 |
|
BLAKE2b-256 | 39f95349bc9c9b18545fe96a17e7270557e2b6c83897d11bc540bd63a30844be |
Close
Hashes for pyrsistent_extras-0.1.1-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6795d2b71b27a98d263b87c8b0f9c707eca03c86302f5242cb69ed00263e5d6c |
|
MD5 | 1fe849eb162d020d540d358ce91525fa |
|
BLAKE2b-256 | 1238037a847e41f791202787ec9da34fbf8e819d710ce479f0e722546ec9a570 |
Close
Hashes for pyrsistent_extras-0.1.1-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48c3d9f98c52cbd3d33c39c44bd936a48a3cb422ee8cd65a247174e9f5fbd19d |
|
MD5 | 4687b2706362576106cf397c51ad7d5e |
|
BLAKE2b-256 | db4a101f44584ae8f9699f2efc5bc5958d10465b32b4cbc6c12b7888e65905c1 |
Close
Hashes for pyrsistent_extras-0.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6f17d4911654660d33df2049857620e88d4a1a41c25777a73c01e8b8bf0c6fc |
|
MD5 | a94f196a7cb0b47494d28778bee66f63 |
|
BLAKE2b-256 | 937299b4af4138ff5d5a497b67a971ae31d7358d2f97e49aec7ba4e896d55218 |
Close
Hashes for pyrsistent_extras-0.1.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44b34094345749699008dcb6fc57a7457c11e8e3d0569a330f7096f375a400d2 |
|
MD5 | fcb9da5a791559a53bfb252721242b4b |
|
BLAKE2b-256 | 9dd22007ca241dbce18de1029dc349b4a73724ab4811a65faf77b4af7824f8ca |
Close
Hashes for pyrsistent_extras-0.1.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb5e4ba0095a514cace4c62616c8913a6cd96526cd1d26849469e512ab3108e9 |
|
MD5 | 06a4d7996dbc7d78605887e28e2f38be |
|
BLAKE2b-256 | 23143bf4450841558916366b79aa44e6a25e1edc1077b02990ec64c7ed959685 |
Close
Hashes for pyrsistent_extras-0.1.1-cp311-cp311-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1bbe80520ed946336acfd5840c77bca498da0f3f5621ec4c5181f730582fb3fe |
|
MD5 | 4bf368767148d63c0a16ad36b40a9e2d |
|
BLAKE2b-256 | 9192eba63beb8e3e4838ce2d08ff925c079bbb82b669a0ed5ea4f1645850a590 |
Close
Hashes for pyrsistent_extras-0.1.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a84c86d66c082e869a47818df72e6d6a42b7accfe26ab27b29b4f94141ec59c |
|
MD5 | 5af63137bbf9dd0c8150b01253a48bbf |
|
BLAKE2b-256 | 9fdfb33df170004bea5d263c4943de14a996ec3c727b371e4865fdd4e1a801b6 |
Close
Hashes for pyrsistent_extras-0.1.1-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cfb0f38257aaf96a6035f20077578e1fb8212601cc87aed2c288eb6d3937ccd |
|
MD5 | 269fd59983b2512609265d0d6ab1a61c |
|
BLAKE2b-256 | 0434f3884c281143c019620871dc77cc40915c1096f22e50dc5650156536c4a4 |
Close
Hashes for pyrsistent_extras-0.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a2d8f7e0a90ee127e869e0e59875d0f7f7c304df274a3c9b4a863f81b80c79f |
|
MD5 | 2a7450a7d69009c9400067c10b722708 |
|
BLAKE2b-256 | 636371f1c44de8c812bfe41c70547e29c9b76affee266cb27db680e4c9cff670 |
Close
Hashes for pyrsistent_extras-0.1.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f39ea3046f95d46383b7c78e9cc28433b13cdaeadfd6b0007b0bed7be5ccd88c |
|
MD5 | 5cadb1071ef980a266fec3bbd0d8d90b |
|
BLAKE2b-256 | 8d3607f139657f388b01203bcb086fa4467e1fd68f8d65bf7ca453575951dcf4 |
Close
Hashes for pyrsistent_extras-0.1.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 439bb892de91f8b6ebd37571b3dd804301bcb675589a52d8d68d095a4f8c1c90 |
|
MD5 | 3e22ba122239085611277e038b0371e2 |
|
BLAKE2b-256 | 8099fbfa188eb6bc0b2cbb92c91b6281413163967730871e9e7e6b8064b03788 |
Close
Hashes for pyrsistent_extras-0.1.1-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee4736cab1a1fc43dc89d74dbceba62a17f7cecddc3b9b1fdf2de5b2ef7ae8c9 |
|
MD5 | 6e9722faaf534365adf68befda986aa8 |
|
BLAKE2b-256 | d54c685f891444aa1c64f2da3caddb386d12202bb6f4340328e53937ad9041ef |
Close
Hashes for pyrsistent_extras-0.1.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34856e306fcd6ee743df7b6808fac720a4f8611d4de148d3ffb803ddcb505700 |
|
MD5 | e1a48e096e6874b8266a64c1eceeabbd |
|
BLAKE2b-256 | 96d4dbe1e2a56ba4d6b3da487d4ea95eb79e8f793449e7a9300a34acbc5a3cd1 |
Close
Hashes for pyrsistent_extras-0.1.1-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21886075b838d28e052dd9811370273380d28577a8d7d4ec242d9ea614d6790a |
|
MD5 | 216c14bb8868b01d0f6b563037ea17b6 |
|
BLAKE2b-256 | 01e7f80a404e033ff9de20d592a6d29db258dd37266b1f252d1271599d6e258f |
Close
Hashes for pyrsistent_extras-0.1.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24c9d7bdc6197f623cef8628bb0f9e215964230a7411c7f4def74e6426da2987 |
|
MD5 | dc507219f61a68f2f62284580d64f000 |
|
BLAKE2b-256 | ddde80d5174346b5474fc271aeb39814561abd0524aef60087e6ca85e61088d8 |
Close
Hashes for pyrsistent_extras-0.1.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e533519b48f5167f0bb6e7c437ea699db6ec5c2d2892b1a3ac55b0000b8dea6 |
|
MD5 | bf319fcef7db7be35544027d22e5918d |
|
BLAKE2b-256 | ebf482eb10db77ee17c5110e408b03c9049495ca49263e7f7664bfd0a8a89b2f |
Close
Hashes for pyrsistent_extras-0.1.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24619ccfb14601ddf9672f2c352e71db08b64e9461d936ab907434729a43e708 |
|
MD5 | 1dc7800cfda577b1cee87bf70a5924c6 |
|
BLAKE2b-256 | 0572557a9a45a2e53f79a172894895e9446783cb85082cf6a27b0f894907b171 |
Close
Hashes for pyrsistent_extras-0.1.1-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dcb60b2b41f17c83ed2cf93e6b7b1419a3eed74b6a09570c295cad0e1a687de9 |
|
MD5 | 4a3f6fa6cfaa467304083e87b8c2724c |
|
BLAKE2b-256 | a51eebecf6b9927c1592ae9d165962a880705164e8c5a9e9a4ae3670bab44e47 |
Close
Hashes for pyrsistent_extras-0.1.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 251ec2aaf72c54f1ded030f50157ced479324d29730ed9223840c2daaa1eff52 |
|
MD5 | bc9a8cfcdb66acbad5c9f8e31fc54575 |
|
BLAKE2b-256 | 71d805c07cd20a5d1c83aa9ce18d6fc28f6a4b589772cebec6a3c3f2c24e83af |
Close
Hashes for pyrsistent_extras-0.1.1-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0a6c1f26caf13cbdd587e38a6e2e0e3299817447730ca62b926e2c828088e38 |
|
MD5 | b13d066ae4e40979bcd7e10fbf35649f |
|
BLAKE2b-256 | a7e13d1c567ef7644e9dded289fb7053d937a2f7194a1dd43d2317854ecbc8a1 |
Close
Hashes for pyrsistent_extras-0.1.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cd2170d78753a05d05020c154cc38f25de8929e152fdb860344b93cdaa82105 |
|
MD5 | 8f837f2bdb0be289513018217de32d3d |
|
BLAKE2b-256 | f9316f5b87953c858db3c6a86d01f7bad0a04b53452bbbd8687e02d536c1833e |
Close
Hashes for pyrsistent_extras-0.1.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cf95631f326df034e9efe661bd62f562b337e1437117e3d7028cb6f483ff84b |
|
MD5 | 891fddfc869eaba487a52e6f9db4d7ca |
|
BLAKE2b-256 | 2900c41106073bdee272474ffc8619ead2fb6a41b51f32c7270a57a8ffb94678 |
Close
Hashes for pyrsistent_extras-0.1.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2bab9f67b477e8edda98e22082f5ae345633791fa345202bb9369506a38fb76e |
|
MD5 | aa9ccec303725bbc55f6f379811de6ab |
|
BLAKE2b-256 | 3d6146b3348d408d0ca47c10b69507c796a97207ce3673a42c25a158dc956678 |
Close
Hashes for pyrsistent_extras-0.1.1-cp38-cp38-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10c3c9706d2ea97b94a4a46b55f33e94ec0b7c2839a279ff5363111c2cfe4286 |
|
MD5 | 48207cae8480f928b382d84dd23ccfbc |
|
BLAKE2b-256 | 5dcb5adc1e58b963959236bd1c352668010cc8690cd382e0f25fa56e11c87193 |