4 Summary: A list-like structure which implements collections.abc.MutableSequence
5 Home-page: https://github.com/aio-libs/frozenlist
7 Author-email: fafhrd91@gmail.com
8 Maintainer: Martijn Pieters <mj@zopatista.com>
9 Maintainer-email: aio-libs@googlegroups.com
11 Project-URL: Chat: Gitter, https://gitter.im/aio-libs/Lobby
12 Project-URL: CI: Github Actions, https://github.com/aio-libs/frozenlist/actions
13 Project-URL: Coverage: codecov, https://codecov.io/github/aio-libs/frozenlist
14 Project-URL: Docs: RTD, https://frozenlist.readthedocs.io
15 Project-URL: GitHub: issues, https://github.com/aio-libs/frozenlist/issues
16 Project-URL: GitHub: repo, https://github.com/aio-libs/frozenlist
17 Description: ==========
21 .. image:: https://github.com/aio-libs/frozenlist/workflows/CI/badge.svg
22 :target: https://github.com/aio-libs/frozenlist/actions
23 :alt: GitHub status for master branch
25 .. image:: https://codecov.io/gh/aio-libs/frozenlist/branch/master/graph/badge.svg
26 :target: https://codecov.io/gh/aio-libs/frozenlist
27 :alt: codecov.io status for master branch
29 .. image:: https://badge.fury.io/py/frozenlist.svg
30 :target: https://pypi.org/project/frozenlist
31 :alt: Latest PyPI package version
33 .. image:: https://readthedocs.org/projects/frozenlist/badge/?version=latest
34 :target: https://frozenlist.readthedocs.io/
35 :alt: Latest Read The Docs
37 .. image:: https://img.shields.io/discourse/topics?server=https%3A%2F%2Faio-libs.discourse.group%2F
38 :target: https://aio-libs.discourse.group/
39 :alt: Discourse group for io-libs
41 .. image:: https://badges.gitter.im/Join%20Chat.svg
42 :target: https://gitter.im/aio-libs/Lobby
48 ``frozenlist.FrozenList`` is a list-like structure which implements
49 ``collections.abc.MutableSequence``. The list is *mutable* until ``FrozenList.freeze``
50 is called, after which list modifications raise ``RuntimeError``:
53 >>> from frozenlist import FrozenList
54 >>> fl = FrozenList([17, 42])
56 >>> fl.append('Vikings')
58 <FrozenList(frozen=False, [17, 42, 'spam', 'Vikings'])>
61 <FrozenList(frozen=True, [17, 42, 'spam', 'Vikings'])>
64 >>> fl.append("Monty")
65 Traceback (most recent call last):
66 File "<stdin>", line 1, in <module>
67 File "frozenlist/_frozenlist.pyx", line 97, in frozenlist._frozenlist.FrozenList.append
69 File "frozenlist/_frozenlist.pyx", line 19, in frozenlist._frozenlist.FrozenList._check_frozen
70 raise RuntimeError("Cannot modify frozen list.")
71 RuntimeError: Cannot modify frozen list.
74 FrozenList is also hashable, but only when frozen. Otherwise it also throws a RuntimeError:
77 >>> fl = FrozenList([17, 42, 'spam'])
79 Traceback (most recent call last):
80 File "<stdin>", line 1, in <module>
81 File "frozenlist/_frozenlist.pyx", line 111, in frozenlist._frozenlist.FrozenList.__hash__
82 raise RuntimeError("Cannot hash unfrozen list.")
83 RuntimeError: Cannot hash unfrozen list.
87 >>> dictionary = {fl: 'Vikings'} # frozen fl can be a dict key
89 {<FrozenList(frozen=True, [1, 2])>: 'Vikings'}
97 $ pip install frozenlist
99 The library requires Python 3.6 or newer.
105 https://frozenlist.readthedocs.io/
107 Communication channels
108 ======================
110 *aio-libs discourse group*: https://aio-libs.discourse.group
112 Feel free to post your questions and ideas here.
114 *gitter chat* https://gitter.im/aio-libs/Lobby
124 ``frozenlist`` is offered under the Apache 2 license.
129 The project is hosted on GitHub_
131 Please file an issue in the `bug tracker
132 <https://github.com/aio-libs/frozenlist/issues>`_ if you have found a bug
133 or have some suggestions to improve the library.
135 .. _GitHub: https://github.com/aio-libs/frozenlist
142 You should *NOT* be adding new change log entries to this file, this
143 file is managed by towncrier. You *may* edit previous change logs to
144 fix problems like typo corrections or such.
145 To add a new change log entry, please see
146 https://pip.pypa.io/en/latest/development/contributing/#news-entries
147 we named the news folder "changes".
149 WARNING: Don't drop the next directive!
151 .. towncrier release notes start
159 - Provide x86 Windows wheels.
160 `#169 <https://github.com/aio-libs/frozenlist/issues/169>`_
172 - Add support for hashing of a frozen list.
173 `#136 <https://github.com/aio-libs/frozenlist/issues/136>`_
175 - Support Python 3.8 and 3.9.
177 - Provide wheels for ``aarch64``, ``i686``, ``ppc64le``, ``s390x`` architectures on
178 Linux as well as ``x86_64``.
187 Deprecations and Removals
188 -------------------------
190 - Dropped support for Python 3.5; only 3.6, 3.7 and 3.8 are supported going forward.
191 `#24 <https://github.com/aio-libs/frozenlist/issues/24>`_
193 Classifier: License :: OSI Approved :: Apache Software License
194 Classifier: Intended Audience :: Developers
195 Classifier: Programming Language :: Python
196 Classifier: Programming Language :: Python :: 3
197 Classifier: Programming Language :: Python :: 3.6
198 Classifier: Programming Language :: Python :: 3.7
199 Classifier: Programming Language :: Python :: 3.8
200 Classifier: Programming Language :: Python :: 3.9
201 Classifier: Development Status :: 5 - Production/Stable
202 Classifier: Operating System :: POSIX
203 Classifier: Operating System :: MacOS :: MacOS X
204 Classifier: Operating System :: Microsoft :: Windows
205 Requires-Python: >=3.6
206 Description-Content-Type: text/x-rst