Skip to main content

A list-like structure which implements collections.abc.MutableSequence

Project description

frozenlist

Azure Pipelines status for master branch codecov.io status for master branch Latest PyPI package version Latest Read The Docs Discourse group for io-libs Chat on Gitter

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
<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.

Installation

$ pip install frozenlist

The library requires Python 3.6 or newer.

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.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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for frozenlist, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size frozenlist-1.0.0-cp36-cp36m-macosx_10_13_x86_64.whl (77.9 kB) File type Wheel Python version cp36 Upload date Hashes View hashes
Filename, size frozenlist-1.0.0-cp36-cp36m-manylinux1_x86_64.whl (153.2 kB) File type Wheel Python version cp36 Upload date Hashes View hashes
Filename, size frozenlist-1.0.0-cp36-cp36m-win32.whl (79.7 kB) File type Wheel Python version cp36 Upload date Hashes View hashes
Filename, size frozenlist-1.0.0-cp36-cp36m-win_amd64.whl (84.5 kB) File type Wheel Python version cp36 Upload date Hashes View hashes
Filename, size frozenlist-1.0.0-cp37-cp37m-macosx_10_13_x86_64.whl (77.1 kB) File type Wheel Python version cp37 Upload date Hashes View hashes
Filename, size frozenlist-1.0.0-cp37-cp37m-manylinux1_x86_64.whl (153.2 kB) File type Wheel Python version cp37 Upload date Hashes View hashes
Filename, size frozenlist-1.0.0-cp37-cp37m-win32.whl (74.9 kB) File type Wheel Python version cp37 Upload date Hashes View hashes
Filename, size frozenlist-1.0.0-cp37-cp37m-win_amd64.whl (80.1 kB) File type Wheel Python version cp37 Upload date Hashes View hashes
Filename, size frozenlist-1.0.0-cp38-cp38-macosx_10_13_x86_64.whl (77.4 kB) File type Wheel Python version cp38 Upload date Hashes View hashes
Filename, size frozenlist-1.0.0-cp38-cp38-manylinux1_x86_64.whl (159.0 kB) File type Wheel Python version cp38 Upload date Hashes View hashes
Filename, size frozenlist-1.0.0-cp38-cp38-win32.whl (75.4 kB) File type Wheel Python version cp38 Upload date Hashes View hashes
Filename, size frozenlist-1.0.0-cp38-cp38-win_amd64.whl (80.6 kB) File type Wheel Python version cp38 Upload date Hashes View hashes
Filename, size frozenlist-1.0.0.tar.gz (60.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page