### Installing frozenlist Source: https://github.com/aio-libs/frozenlist/blob/master/README.rst Command to install the library via pip. ```bash $ pip install frozenlist ``` -------------------------------- ### Enable Cython tracing during installation Source: https://github.com/aio-libs/frozenlist/blob/master/CHANGES.rst Use this command to enable line tracing in Cython builds for coverage measurement during installation. ```console $ python3 -Im pip install . --config-settings=with-cython-tracing=true ``` -------------------------------- ### Build and Test with Makefile Source: https://github.com/aio-libs/frozenlist/blob/master/AGENTS.md Use these commands to install dependencies, build the Cython extension, and run the test suite. ```bash make .develop # installs deps, runs lint, builds the extension in place make test # quiet pytest run ``` -------------------------------- ### Example of a feature changelog entry Source: https://github.com/aio-libs/frozenlist/blob/master/CHANGES/README.rst A sample content for CHANGES/553.feature.rst documenting new support for GenericAliases. ```rst Added support for ``GenericAliases`` (``MultiDict[str]``) under Python 3.9 and higher -- by :user:`mjpieters`. ``` -------------------------------- ### Example of a removal changelog entry Source: https://github.com/aio-libs/frozenlist/blob/master/CHANGES/README.rst A sample content for CHANGES/603.removal.1.rst documenting a dropped Python version support. ```rst Dropped Python 3.5 support; Python 3.6 is the minimal supported Python version -- by :user:`webknjaz`. ``` -------------------------------- ### Perform editable install for Cython coverage Source: https://github.com/aio-libs/frozenlist/blob/master/CHANGES.rst Use this command to produce C-files required for the Cython coverage plugin to map measurements to PYX-files. ```console $ python -Im pip install -e . ``` -------------------------------- ### Example of a bugfix changelog entry Source: https://github.com/aio-libs/frozenlist/blob/master/CHANGES/README.rst A sample content for CHANGES/550.bugfix.rst documenting a fix related to Windows wheels. ```rst Started shipping Windows wheels for the x86 architecture -- by :user:`Dreamsorcerer`. ``` -------------------------------- ### CHANGES Fragment Example Source: https://github.com/aio-libs/frozenlist/blob/master/AGENTS.md An example of a towncrier news fragment using reStructuredText. The filename should follow the pattern ..rst. ```rst Fixed ``copy.copy()`` sharing the internal list between the original and the copy, so mutating one no longer mutates the other -- by :user:`github-handle`. ``` -------------------------------- ### Build documentation locally Source: https://github.com/aio-libs/frozenlist/blob/master/docs/contributing/guidelines.rst Execute this command to trigger the Sphinx documentation generation process on your local machine. ```shell-session $ make doc ``` -------------------------------- ### Build pure-python distribution with pip Source: https://github.com/aio-libs/frozenlist/blob/master/CHANGES.rst Use this command to build frozenlist from source without a C-extension using pip. ```console $ python3 -m pip install . --config-settings=pure-python= ``` -------------------------------- ### Build pure-python distribution with pypa/build Source: https://github.com/aio-libs/frozenlist/blob/master/CHANGES.rst Use this command to build frozenlist from source without a C-extension using the pypa/build tool. ```console $ python3 -m build --config-setting=pure-python= ``` -------------------------------- ### Using FrozenList and freezing it Source: https://github.com/aio-libs/frozenlist/blob/master/README.rst Demonstrates initializing a FrozenList, appending items, and calling freeze() to prevent further modifications. Attempting to append after freezing raises a RuntimeError. ```python >>> from frozenlist import FrozenList >>> fl = FrozenList([17, 42]) >>> fl.append('spam') >>> fl.append('Vikings') >>> fl >>> fl.freeze() >>> fl >>> fl.frozen True >>> fl.append("Monty") Traceback (most recent call last): File "", line 1, in 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. ``` -------------------------------- ### Push release tag to upstream Source: https://github.com/aio-libs/frozenlist/blob/master/docs/contributing/release_guide.rst Push the created version tag to the origin repository to trigger the CI/CD pipeline. ```shell-session [dir:frozenlist] $ git push origin 'VERSION_WITH_LEADING_V' ``` -------------------------------- ### Update version and generate changelog Source: https://github.com/aio-libs/frozenlist/blob/master/docs/contributing/release_guide.rst Commands to update the version in frozenlist/__init__.py, generate the changelog using towncrier, and commit the changes. Replace 'VERSION_WITHOUT_LEADING_V' with the actual version number without a 'v' prefix. ```shell-session [dir:frozenlist] $ frozenlist/__init__.py [dir:frozenlist] $ python -m towncrier build \ -- --version 'VERSION_WITHOUT_LEADING_V' [dir:frozenlist] $ git commit -v CHANGES{.rst,/} frozenlist/__init__.py ``` -------------------------------- ### Create Symlink for News Fragment Source: https://github.com/aio-libs/frozenlist/blob/master/AGENTS.md Command to create a symlink when both an issue and a PR number are involved, ensuring towncrier and GitHub cross-references function correctly. ```bash ln -s 757.contrib.rst CHANGES/760.contrib.rst ``` -------------------------------- ### Tag the release commit Source: https://github.com/aio-libs/frozenlist/blob/master/docs/contributing/release_guide.rst Create a GPG-signed Git tag for the release. Replace 'VERSION_WITH_LEADING_V' with the version number prefixed with 'v'. ```shell-session [dir:frozenlist] $ git tag \ -s 'VERSION_WITH_LEADING_V' \ -m 'VERSION_WITH_LEADING_V' \ -m 'This release does X and Y.' ``` -------------------------------- ### frozenlist.FrozenList(items) Source: https://github.com/aio-libs/frozenlist/blob/master/docs/index.rst Constructor for creating a new non-frozen list instance. ```APIDOC ## class frozenlist.FrozenList(items) ### Description Constructs a new non-frozen list from an iterable of items. The list is mutable until the freeze() method is called. ### Parameters - **items** (iterable) - Required - The initial items to populate the list. ``` -------------------------------- ### frozenlist.FrozenList.freeze() Source: https://github.com/aio-libs/frozenlist/blob/master/docs/index.rst Method to permanently freeze the list. ```APIDOC ## method frozenlist.FrozenList.freeze() ### Description Freezes the list, making it immutable and hashable. Once called, there is no way to thaw the list back to a mutable state. ``` -------------------------------- ### Agent Run Details Collapsed Block Source: https://github.com/aio-libs/frozenlist/blob/master/AGENTS.md Recommended format for surfacing agent-generated logs or scan results in a collapsed details block at the bottom of the PR. ```markdown
Agent run details (optional, for reviewers) Tests: Lint:
``` -------------------------------- ### Pull Request Template Source: https://github.com/aio-libs/frozenlist/blob/master/AGENTS.md The mandatory template for all pull requests. Fill this out verbatim, ensuring all applicable checklist items are marked. ```markdown ## What do these changes do? ## Are there changes in behavior for the user? ## Related issue number Fixes #NNNN ## Checklist - [x] I think the code is well written - [x] Unit tests for the changes exist - [x] Documentation reflects the changes - [ ] If you provide code modifications, please add yourself to `CONTRIBUTORS.txt` - [x] Add a new news fragment into the `CHANGES` folder ``` -------------------------------- ### Hashing a FrozenList Source: https://github.com/aio-libs/frozenlist/blob/master/README.rst Shows that a FrozenList is only hashable after it has been frozen. An unfrozen list raises a RuntimeError when passed to hash(). ```python >>> fl = FrozenList([17, 42, 'spam']) >>> hash(fl) Traceback (most recent call last): File "", line 1, in 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 {: 'Vikings'} ``` -------------------------------- ### frozenlist.FrozenList.frozen Source: https://github.com/aio-libs/frozenlist/blob/master/docs/index.rst Read-only property to check the frozen status of the list. ```APIDOC ## property frozenlist.FrozenList.frozen ### Description A read-only property that returns True if the list is frozen, meaning modifications are forbidden. ``` -------------------------------- ### PR Body Agent Disclosure Line Source: https://github.com/aio-libs/frozenlist/blob/master/AGENTS.md A plain line required at the bottom of the PR body to disclose the agent used for drafting changes. ```markdown Drafted with ; reviewed by . ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.