flake8-mutable
mutable defaults flake8 extension
Decision gist · record as of 2026-08-14
Yes, if you use flake8 and want to catch mutable default arguments automatically. The plugin is lightweight, has no dependencies, and addresses a real Python pitfall. The long gap since the last release (2017) is a minor concern, but the repository remains active and the plugin's scope is narrow enough that it is unlikely to break with new Python versions.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires flake8 to be installed and available in your environment; the plugin integrates as a flake8 extension.
- Low friction install with no runtime dependencies.
- Last release was in 2017 but the repository remains active with a recent commit in 2026, suggesting ongoing maintenance despite infrequent version updates.
License · maintenance · safety
MIT (permissive) — MIT license is permissive and poses no restrictions on commercial or private use.
last release 2017-04-24 (3399 days) · last repo commit 2026-04-13 · 44 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 166,166 downloads/mo, #10,506 on PyPI
Alternatives
Verify before relying
pip install flake8-mutable
Then run flake8 on your code:
flake8 your_file.py
flake8 will report violations like:
foo.py:2:14: M511 - mutable default arg of type Dict- Whether the package actively detects all mutable types (lists, dicts, sets) or if coverage has gaps.
- Current compatibility with recent flake8 versions and Python 3.7+, given the latest release was in 2017.
What it is and what it does
flake8-mutable is a linter plugin for flake8 that catches a subtle but common Python gotcha: mutable default arguments. When you define a function with a mutable default like `def func(arg=[])`, that same list object is reused across all calls, so mutations in one call affect subsequent calls. This plugin scans your code and flags these patterns with error codes like M511 for dict defaults.
It integrates directly into flake8's checking pipeline, so once installed, it runs automatically when you invoke flake8 on your codebase. The plugin has no runtime dependencies beyond flake8 itself, making it a lightweight addition to your linting setup. It's designed for developers who want to catch this class of bug early during code review or CI/CD checks.
Use it for
- Add to your flake8 configuration in CI/CD to catch mutable defaults before code review.
- Use during local development to flag function definitions with mutable defaults as you write.
- Audit an existing codebase for instances of this anti-pattern across many files at once.
- Enforce a team coding standard that prohibits mutable defaults in function signatures.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you use flake8 and want to catch mutable default arguments automatically.
The plugin is lightweight, has no dependencies, and addresses a real Python pitfall. The long gap since the last release (2017) is a minor concern, but the repository remains active and the plugin's scope is narrow enough that it is unlikely to break with new Python versions.
Install
flake8-mutable on PyPI
Before you install
Low friction install with no runtime dependencies. Last release was in 2017 but the repository remains active with a recent commit in 2026, suggesting ongoing maintenance despite infrequent version updates.
Requires flake8 to be installed and available in your environment; the plugin integrates as a flake8 extension.
License in practice
MIT license is permissive and poses no restrictions on commercial or private use.
Quickstart
pip install flake8-mutable
Then run flake8 on your code:
flake8 your_file.py
flake8 will report violations like:
foo.py:2:14: M511 - mutable default arg of type Dict
Verify before relying
- Whether the package actively detects all mutable types (lists, dicts, sets) or if coverage has gaps.
- Current compatibility with recent flake8 versions and Python 3.7+, given the latest release was in 2017.
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 3,399 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 166,166 / month, #10,506 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Topic :: Software Development :: Libraries :: Python Modules |
Evidence: flake8_mutable-1.2.0-py2-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “flake8 mutable defaults”
- flake8-mutableA flake8 plugin that detects mutable default arguments in Python…
- flake8-bugbearA flake8 plugin that detects likely bugs and design problems in…
- namedlistCreates mutable or immutable named tuple-like classes with support…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also flake8-bugbear · flake8-logging · flake8-rst-docstrings · cython-lint · flake8-isort · flake8-string-format · flake8-pie · flake8-builtins · flake8-unused-arguments · flake8-functions