A list-like structure which implements collections.abc.MutableSequence
Project description
frozenlist
Introduction
frozenlist.FrozenList is a list-like structure which implements collections.abc.MutableSequence. The list is mutable until FrozenList.freeze is called, after which list modifications raise RuntimeError:
>>> from frozenlist import FrozenList >>> fl = FrozenList([17, 42]) >>> fl.append('spam') >>> fl.append('Vikings') >>> fl <FrozenList(frozen=False, [17, 42, 'spam', 'Vikings'])> >>> fl.freeze() >>> fl <FrozenList(frozen=True, [17, 42, 'spam', 'Vikings'])> >>> fl.frozen True >>> fl.append("Monty") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "frozenlist/_frozenlist.pyx", line 97, in frozenlist._frozenlist.FrozenList.append self._check_frozen() File "frozenlist/_frozenlist.pyx", line 19, in frozenlist._frozenlist.FrozenList._check_frozen raise RuntimeError("Cannot modify frozen list.") RuntimeError: Cannot modify frozen list.
FrozenList is also hashable, but only when frozen. Otherwise it also throws a RuntimeError:
>>> fl = FrozenList([17, 42, 'spam']) >>> hash(fl) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "frozenlist/_frozenlist.pyx", line 111, in frozenlist._frozenlist.FrozenList.__hash__ raise RuntimeError("Cannot hash unfrozen list.") RuntimeError: Cannot hash unfrozen list. >>> fl.freeze() >>> hash(fl) 3713081631934410656 >>> dictionary = {fl: 'Vikings'} # frozen fl can be a dict key >>> dictionary {<FrozenList(frozen=True, [1, 2])>: 'Vikings'}
Installation
$ pip install frozenlist
The library requires Python 3.6 or newer.
Documentation
Communication channels
aio-libs discourse group: https://aio-libs.discourse.group
Feel free to post your questions and ideas here.
gitter chat https://gitter.im/aio-libs/Lobby
Requirements
Python >= 3.6
License
frozenlist is offered under the Apache 2 license.
Source code
The project is hosted on GitHub
Please file an issue in the bug tracker if you have found a bug or have some suggestions to improve the library.
Changelog
1.1.0 (2020-10-13)
Features
Add support for hashing of a frozen list. #136
Support Python 3.8 and 3.9.
Provide wheels for aarch64, i686, ppc64le, s390x architectures on Linux as well as x86_64.
1.0.0 (2019-11-09)
Deprecations and Removals
Dropped support for Python 3.5; only 3.6, 3.7 and 3.8 are supported going forward. #24
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
Built Distributions
Hashes for frozenlist-1.1.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ad3d7cf6c5619e0069630c9904a7e77a08df6728e87d320ef5824decd1f0ec9 |
|
MD5 | 735fa9ebb40b44debb84b9593ac42132 |
|
BLAKE2b-256 | 35fccfe58b0485a54ed6d6f05669cfa3fcf98b77c4b834a324a08c225e37ea0f |
Hashes for frozenlist-1.1.0-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cd0f4014558013db768740f83f7c5b46bbf332b513fcfb8122207922c422d28 |
|
MD5 | 594ef008026b14cc46edd876a6e08996 |
|
BLAKE2b-256 | 2756e97aee35c24b112cff627f4ebec9dd863a806199259fafe4037bc7121951 |
Hashes for frozenlist-1.1.0-cp39-cp39-manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e7382949e27b18436458e0aaf2a50fd8ba98472b67ac9796110b3a689f77064 |
|
MD5 | 220a0d37529bd5eca8abcca05d38dbe4 |
|
BLAKE2b-256 | b515a53483152bae8e9a257bbc01d48864271b82b090540156f942dd5e45959c |
Hashes for frozenlist-1.1.0-cp39-cp39-manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28b0526e95650f44b46d78de7e0302805385b603246f6ec2b4cca6c8fe237c1e |
|
MD5 | 982bdb0c8efb3401bdc5ce06d0f693e3 |
|
BLAKE2b-256 | 0c3a40a6dc0f723cf9d283f97e488cca5db4a8d7195913a0c26b0269ca54ff74 |
Hashes for frozenlist-1.1.0-cp39-cp39-manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4a3abdf0d3cfe8ef6820021a00e7cd33b69bee5bb17feca872af5ed88f0c7bd |
|
MD5 | 2c47085dd0287d89d8594b0b2904f308 |
|
BLAKE2b-256 | 01993f1d98e032d265dda742a43252842233c50b8484b23a6c6197337ede4bcc |
Hashes for frozenlist-1.1.0-cp39-cp39-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e971d7dd20cbcb3b7ce4d85ea4f2bcf927aedb9d88def62c2363c9e2d57eb43e |
|
MD5 | 025ff7799576c2b8c6200ba0eec3b132 |
|
BLAKE2b-256 | ea23c0260cc236953d9e6616d7e1f4325b566eee77f5cffccded225f74cd1a4d |
Hashes for frozenlist-1.1.0-cp39-cp39-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73b6ee423dbda2a0874b30513d200b963740c4e63cc6fb84512c91bb05437f00 |
|
MD5 | c5d2de54be232cc095113a96fd0d81bb |
|
BLAKE2b-256 | c7ac4bcd2b2870c9a40a1888786c83b046040e79732d667ccba3e498937e093f |
Hashes for frozenlist-1.1.0-cp39-cp39-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c92a0e2f732aee60bcae432206cc03073a4b28680bdf016be452108ede58b2e6 |
|
MD5 | 0b7bbfe50714dcd8a41bea45945f38d4 |
|
BLAKE2b-256 | 9a21f96fb6a802a769a40721af39dd86f69bc754051c9138f4d8473e48ec2a47 |
Hashes for frozenlist-1.1.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0d3b015b394ed7ea2a07290abd60cf5651b3c5aa19fe925a62e469d2242e8bb |
|
MD5 | e7a446b8aae23e6f7bc07249d44632aa |
|
BLAKE2b-256 | eb4d13183c129b1dd4cc79cbcae2f0d3806c47b14981c37191e7ebc75725f5b1 |
Hashes for frozenlist-1.1.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9f74781ccc0ce4099a71a35d4888fc1adf945cd495b6a888c67c49747d489d5 |
|
MD5 | 8c4a7092539135e88cb5bc393a0f9bb2 |
|
BLAKE2b-256 | f8ec93c78ca224f5e602a69447d1e0095632c628b073ee3ccca766b5dd5b66c0 |
Hashes for frozenlist-1.1.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b993d4d1731602b52255ae22532eb4ddfecead181fbb089abc5ee8d63cc547c0 |
|
MD5 | e969b508a828e5c69be5cc9cf947ecdc |
|
BLAKE2b-256 | c72575a07dc8aa6c2a7c5aaa49fedc18d2e437e69771cded2e411c591c4e0ba4 |
Hashes for frozenlist-1.1.0-cp38-cp38-manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae553af5fd0656b1bb321010a05e37ea21e529cb0d679fb7f32e16ae0501d543 |
|
MD5 | a471fbb05c50000b27d715a1dbd7e1a8 |
|
BLAKE2b-256 | 61d41d379e4358a48e95b0a939e6749207a9234c5d5ee50e9ab09e1883adc941 |
Hashes for frozenlist-1.1.0-cp38-cp38-manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63183308cd61aa322473a61aa5abc0a1d06c05e138e4fbbaea050acda4000c59 |
|
MD5 | c88546cccd671c4129229541cdd8d99b |
|
BLAKE2b-256 | 6559e7ea153a7012e708b0b12cf9e715cd083776d9e34d8dd649a1615a503a5a |
Hashes for frozenlist-1.1.0-cp38-cp38-manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6cfbcd9d3342c8cb1cabfc8534999034ffa29bef89f2aedf120843e89df3751 |
|
MD5 | 07222d8cd02680451e12741ad4991355 |
|
BLAKE2b-256 | d3609bcede6d82ba702d71b8742e6cac8358b364ea177f984f89b9ae12832dad |
Hashes for frozenlist-1.1.0-cp38-cp38-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76bba172218f9de6fafc394678e59541036cd0366519a0730b3d5a8e922e39ee |
|
MD5 | c55cbb4ab1f821468f4b736c2f3cc4a7 |
|
BLAKE2b-256 | 17bdf08993387c0d006dc31fb8e1b47f360221ce364b5d297dac74cc8669aae8 |
Hashes for frozenlist-1.1.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d2800bc1f773e759368f08ddc3c12e777777e314949e0f93e5a4a0e2748fa4a |
|
MD5 | 727190a5cdcc23ea283a56d48201d19e |
|
BLAKE2b-256 | 182c439e4091f7557af9c274fa5f6f93ea91163c4663b81c97657fabdc5dbdc5 |
Hashes for frozenlist-1.1.0-cp38-cp38-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53dd6e1918fa276458ced1629a2e835ec2c64ce98f8c3099c6dbe69277a47d8c |
|
MD5 | 3babf4e637c8f06434dbe334bc5fa066 |
|
BLAKE2b-256 | 64254e815e62ff55b0eeb90e87a21ede4efed36ceb8c30be16e22e4ffb82e817 |
Hashes for frozenlist-1.1.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4488d9a3adf3eade3898139dd8f7fb6a171ababd15994f33e21a299f219f9751 |
|
MD5 | 12d8b5facbd8566ce04ef37410e527a2 |
|
BLAKE2b-256 | e52cd3d332c10d750106cf96f4e26a4e60f48b19bbc3eaacf5e25de10a679293 |
Hashes for frozenlist-1.1.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51b1f3213c7df179a9db42be61c533691d527f1eb47de428e993ef2bcdb2330a |
|
MD5 | db56eeb7bb116b1fa8cb6c25c3dba9a5 |
|
BLAKE2b-256 | f55b582dbc3bd52c8da4eda096ff0fd6266c0fba35e192aa2085df091d56bc83 |
Hashes for frozenlist-1.1.0-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b63297d7368b4ffc91e25cc930f413b245683af745ebb00f8babb1e619a44a34 |
|
MD5 | da7652016638d3d5b9cd4a66f7c71bbb |
|
BLAKE2b-256 | a6578c9c1e8d9dc98e966303646943a00651f0f0c7b79f1914d2f8f8cfaccf22 |
Hashes for frozenlist-1.1.0-cp37-cp37m-manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6f1a7a1ddece806b2c4af7a4135f1339d3566ff75402eb6e18abb3c35233533 |
|
MD5 | a285a222d23db1a5d7e1e6cdd41c59e0 |
|
BLAKE2b-256 | a9558328175d479f847c381b407096f2131a34bcd5cbe0ffae38eb775bc49c4d |
Hashes for frozenlist-1.1.0-cp37-cp37m-manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c1c6f33129838807db59a94e8f4298a7f24811a3b241dfade193deede609add |
|
MD5 | ed82522a31a024ab3791bec2bb0d6bdd |
|
BLAKE2b-256 | 54014c60c9b7ddc2ae16061f71adbdea09c51504edba9085f347ef819dcc8f88 |
Hashes for frozenlist-1.1.0-cp37-cp37m-manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20d8bebe190a2aae033ee92650f004587dbe1d68520e666fbbeff17e3a718f4a |
|
MD5 | c947a15814de8b18d7a179fb06b5ef52 |
|
BLAKE2b-256 | 2e6588ac00c7efdca9d99932c51e1065abe2740e74de7e16673268b30a326c83 |
Hashes for frozenlist-1.1.0-cp37-cp37m-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f871d1df4bcf9f5b95a73fa62f8a9f4968713f554a9ba6a879805aa43915915e |
|
MD5 | a6991e1bb5f9d02a05bebf0ea8f2553b |
|
BLAKE2b-256 | bbc60b24a1096e173d4aa9e47d9dc3489b804a0552f0f19b104421878f9d03c5 |
Hashes for frozenlist-1.1.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c4b1de8ac9189ece76fd479666269fba1ec9948b94d725319c6fa0918eea2ed |
|
MD5 | 73e80bc65a6c45bea3d0eb89e96afbc6 |
|
BLAKE2b-256 | a1f3c56175fa5e80bead77421933eaded43019b27e980d42a16eacb00e7ac59e |
Hashes for frozenlist-1.1.0-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d501ed2ebdd205014c6721e133092ed755975de75a4cc47dad44b21c5853e6d |
|
MD5 | 6245890016aea43f19010308e570839e |
|
BLAKE2b-256 | abaf20d1124f1675d993005cc977c2588cc3459029ef6701caec1ab4a7134826 |
Hashes for frozenlist-1.1.0-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3597626f4a16928a2b73762441e5f8a64830fde9997d93a44345dc3f8de022c7 |
|
MD5 | b3f448abfb42977b1c8cf89d0676b2b0 |
|
BLAKE2b-256 | 4a601892cda123af1195e398650f8b1a511b289f0ba931c31d0352b0774debc9 |
Hashes for frozenlist-1.1.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03bed628f048655dd729ce5cc8d6630feca982a3c6340774291eeb2c8e1bf542 |
|
MD5 | e5fa0f6f7723aeeffd3879e5b3624884 |
|
BLAKE2b-256 | 8e603e1c151aef02083a3aada1c50284ce626d2f07ba6e5da72e6509a5441933 |
Hashes for frozenlist-1.1.0-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 861f1d9d6f69bf31babfde6edb61b8d2de5c5b0b025e45e4fcbbc93ab30c03a2 |
|
MD5 | 36d878cdd3a7c7e39debd14251fe346f |
|
BLAKE2b-256 | 37f2a3eff936ce80a764ff33fce657daaa0fe64042613c8250a2e28472b607d5 |
Hashes for frozenlist-1.1.0-cp36-cp36m-manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8527c26ca83c4f33f3d1711eda7e611e2f771016aa0a92b97be2be680abada20 |
|
MD5 | 0ab98bfb182efb7cfd43398aea29345a |
|
BLAKE2b-256 | 6d76ba7960310b2e402df384efed309a1d5f86e5593f291a3176278c9139bd26 |
Hashes for frozenlist-1.1.0-cp36-cp36m-manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1c2d00a068fe383048de7cc529e3c48ec3ede3906b88b7d432a8cc15806d829 |
|
MD5 | 14d55b26bff8046f782b454b0c116045 |
|
BLAKE2b-256 | c6d38a16a418691aca1ea255acf04e24a13a6b5bd84de0d4e4017d3f53bf893d |
Hashes for frozenlist-1.1.0-cp36-cp36m-manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a19c1b5e8177607d633f898023bd33c62c38ddfbe439ce6164c00b9331041ae4 |
|
MD5 | 1069d947c119fdb60966cb40ca1c8815 |
|
BLAKE2b-256 | 9a5ee3bdcffc794d5f2eb78438169dfa0af91272642164e86918cb3206e1ecd6 |
Hashes for frozenlist-1.1.0-cp36-cp36m-manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d201e52fbda295e954259a23a73348001ca8f7d3e1c1ea4cb1f398a2ddf86380 |
|
MD5 | 3cb6646305cc273d7bc5bd7014cee5b8 |
|
BLAKE2b-256 | 77047b673a86164908e3f6b36a275143f85cbd536b3e63a312c39c3ee9d03667 |
Hashes for frozenlist-1.1.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a513bd97c75ee5f9854c7e44926821781f9068588363d8351c7172c48f1d0c4 |
|
MD5 | c0f8fb5c2ccb481dacf9cc547914c854 |
|
BLAKE2b-256 | 75105b08e46a7e623f89322e1a2999ca4525e0ecc29cdcb478ce7446f2d03a18 |
Hashes for frozenlist-1.1.0-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e1b39504ac0cf78f96c6e15e5cf964cd22eb3fe9c3581ec40ecc4c2612d4559 |
|
MD5 | f0a6b04628995d7a03cef23e55c3529f |
|
BLAKE2b-256 | adf33e966da6ba7dcb456271d2ced81cb730ce2a66616c427b6b527c8eafe5e0 |
Hashes for frozenlist-1.1.0-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93aa981a6458f8b950109e85779765527cd16df5df4f1a015bcd8f265c3f7c5b |
|
MD5 | e9b441ae2f5546d137882a78f0befbd8 |
|
BLAKE2b-256 | 4d4e302945d040be5aaeba99582ee68decfe84361da660691a3b42bd7e04e5b8 |