NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #931 most downloaded on PyPI
Find dead code
Last release 6 months ago
25 Mar 2026
Release timing varies
gaps range from 1 weeks to 1.2 years
Nearly every release is documented
notes for 56 of 56 stable releases
Nothing withdrawn
no release was ever pulled
15 years old
56 releases · first in 2012
Fix false positives for dead code after while loops ( #412 , #413 , Jendrik Seipp).
Handle while True loops without break statements (kreathon).
One column per quarter.
Improve reachability analysis (kreathon, #270, #302).
get_unused_code and the fields of the Item class (John Doknjas, #361).Add support for Python 3.13 (Jendrik Seipp, #369).
tests/**/*.toml in sdist (Colin Watson).Use ruff for linting and formatting (Anh Trinh, #347, #349).
ruff for linting and formatting (Anh Trinh, #347, #349).tox by pre-commit for linting and formatting (Anh Trinh, #349).--config flag to specify path to pyproject.toml configuration file (Glen Robertson, #352).Switch to tomllib/tomli to support heterogeneous arrays (Sebastian Csar, #340).
MagicMock and Mock (maxrake, #342).Drop support for Python 3.7 (Jendrik Seipp, #323).
end_lineno AST attribute to obtain more accurate line counts (Jendrik Seipp).Use exit code 0 for --help and --version again (Jendrik Seipp, #321).
--help and --version again (Jendrik Seipp, #321).Use exit code 3 when dead code is found (whosayn, #319).
Add UnicodeEncodeError exception handling to core.py (milanbalazs, #299 ).
Ignore setup_module(), teardown_module(), etc. in pytest test_*.py files (Jendrik Seipp).
setup_module(), teardown_module(), etc. in pytest test_*.py files (Jendrik Seipp).socketserver.TCPServer.allow_reuse_address (Ben Elliston).--exclude patterns are matched against absolute paths (Jendrik Seipp, #260).Add basic match statement support (kreathon, #276, #291).
match statement support (kreathon, #276, #291).Mark imports in __all__ as used (kreathon, #172, #282).
__all__ as used (kreathon, #172, #282).pint.UnitRegistry.default_formatter (Ben Elliston, #258).Print absolute filepaths as relative again (as in version 2.1 and before) if they are below the current directory (The-Compiler, #246).
del keyword to mark unused variables (sshishov, #279).Add pre-commit hook (Clément Robert, #244).
Only parse format strings when being used with locals() (jingw, #225).
locals() (jingw, #225).Treat getattr/hasattr(obj, "constant_string", ...) as a reference to obj.constant_string (jingw, #219).
getattr/hasattr(obj, "constant_string", ...) as a reference to
obj.constant_string (jingw, #219).x.some_name but reading via
some_name, at the cost of potential false negatives (jingw, #221).pyproject.toml (Michel Albert, #164, #215).Parse # type: ... comments if on Python 3.8+ (jingw, #220).
# type: ... comments if on Python 3.8+ (jingw, #220).test or tests directories test files
(Jendrik Seipp).logging.Logger.propagate attribute (Jendrik Seipp).Differentiate between functions and methods (Jendrik Seipp, #112, #209).
Support flake8 "noqa" error codes F401 (unused import) and F841 (unused local variable) (RJ722, #195).
Ignore unused import statements in __init__.py (RJ722, #192).
__init__.py (RJ722, #192).Detect redundant 'if' conditions without 'else' blocks.
string.Formatter (Joseph Bylund, #183).Fix tests for Python 3.8 (#166).
Constant AST node under Python 3.8+ (#175).logging module.Add sys.excepthook to sys whitelist.
sys.excepthook to sys whitelist.ctypes module.Add --ignore-decorators flag (thanks @RJ722).
--ignore-decorators flag (thanks @RJ722).threading module (thanks @andrewhalle).Add --ignore-names flag for ignoring names matching the given glob patterns (thanks @RJ722).
--ignore-names flag for ignoring names matching the given glob
patterns (thanks @RJ722).Add --make-whitelist flag for reporting output in whitelist format (thanks @RJ722).
--make-whitelist flag for reporting output in whitelist format
(thanks @RJ722).--exclude arguments on Windows.*-test.py to recognized test file patterns.failureException, longMessage and maxDiff to unittest
whitelist.Report while (True): ... else: ... as unreachable (thanks @RJ722).
while (True): ... else: ... as unreachable (thanks @RJ722).argparse instead of optparse.Detect async function definitions (thanks @RJ722).
async function definitions (thanks @RJ722).Item.get_report() method (thanks @RJ722).Detect unsatisfiable statements containing and, or and not.
and, or and not.scavenge() and report().Detect unsatisfiable while-conditions (thanks @RJ722).
while-conditions (thanks @RJ722).if- and else-conditions (thanks @RJ722).Add --min-confidence flag (thanks @RJ722).
--min-confidence flag (thanks @RJ722).Detect unreachable code after return, break, continue and raise (thanks @RJ722).
return, break, continue and
raise (thanks @RJ722).If an unused item is defined multiple times, report it multiple times.
Report unused tuple assignments as dead code.
object (thanks @RJ722).Don't ignore \_\_foo variable names.
Make --sort-by-size faster and more accurate (thanks @RJ722).
Add get\_unused\_code() method.
Differentiate between unused classes and functions (thanks @RJ722).
Automatically include whitelists based on imported modules (thanks @RJ722).
Add stub whitelist file for Python standard library (thanks @RJ722)
Ignore star-imported names since we cannot detect whether they are used.
Use tokenize.open() on Python \>= 3.2 for reading input files, assume UTF-8 encoding on older Python versions.
Use the system's default encoding when reading files.
Detect unused function and method arguments (issue #15).
Don't flag attributes as unused if they are used as global variables in another module (thanks Florian Bruhin).
* Fix code for Python 3.
Do not flag names imported with "import as" as dead code (thanks Tom Terrace).
Exit with exitcode 1 if path on commandline can't be found.
Ignore function names starting with "test\_".
If dead code is found, exit with 1.
Only warn if a path given on the command line cannot be found.
Ignore unused variables starting with an underscore.
Find tuple assignments in comprehensions
Only format nodes in verbose mode (gives 4x speedup).
* First release.
Your coding agent can read these notes before it upgrades. Set up the MCP server →