Flake8 plugin that requires frozendict and frozenset instead of dict and set
Project description
flake8-frozen-collections
A Flake8 plugin that prohibits the use of mutable dict and set, requiring frozendict and frozenset instead.
Installation
pip install flake8-frozen-collections
Usage
flake8 your_project/
Error Codes
| Code | Description |
|---|---|
| FCS100 | Use frozendict instead of dict |
| FCS200 | Use frozenset instead of set |
What Is Checked
- Literals
{...}and{key: value} - Calls to
dict(...)andset(...) - dict/set comprehensions
- Type annotations
dict[...],set[...],dict,set - Checks
isinstance(..., dict)andisinstance(..., set)
Example
# Bad
mapping: dict[str, int] = {"a": 1}
tags: set[str] = {"x", "y"}
# Good
from frozendict import frozendict
mapping = frozendict({"a": 1})
tags = frozenset({"x", "y"})
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 Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flake8_frozen_collections-0.0.1.tar.gz.
File metadata
- Download URL: flake8_frozen_collections-0.0.1.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.13.6 Darwin/24.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2689b7fbcaba1ec0f6c4bbd637f508aec1748eb8a24c8597271315575063c80b
|
|
| MD5 |
ae1db0103365bbb93511d723e6895907
|
|
| BLAKE2b-256 |
8c9c974face5b03445058db6b986c755168263eefbcb25c6352718418976d456
|
File details
Details for the file flake8_frozen_collections-0.0.1-py3-none-any.whl.
File metadata
- Download URL: flake8_frozen_collections-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.13.6 Darwin/24.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac152d85b3dac6699e3db12e83f0484f20b9ed5d87ea7720bc5159d1e60f00f4
|
|
| MD5 |
0196a8b76c8f9fdb22a4a7586a3053eb
|
|
| BLAKE2b-256 |
c08aa6e4c986a32a1ecc14358121a8682293889dc1d2995d9d7a82f4081507b0
|