{"id":3494,"library":"flake8-print","title":"flake8-print","description":"Flake8 print plugin. This module provides a plugin for flake8, the Python code checker, specifically designed to identify and flag the use of `print` statements in Python files. The current version is 5.0.0, and it has a moderate release cadence with several updates per year, including major versions for significant changes.","status":"active","version":"5.0.0","language":"en","source_language":"en","source_url":"https://github.com/jbkahn/flake8-print","tags":["flake8","linter","code quality","print statements"],"install":[{"cmd":"pip install flake8-print","lang":"bash","label":"Install flake8-print"}],"dependencies":[{"reason":"This is a plugin for flake8, requiring flake8 itself to be installed for functionality.","package":"flake8","optional":false}],"imports":[{"note":"Flake8 plugins are automatically loaded by the flake8 command-line tool once installed, so no explicit Python import statement is typically used in user code.","symbol":"Usage as a plugin","correct":"No direct import is needed; flake8 automatically discovers installed plugins via entry points."}],"quickstart":{"code":"print('This line will be flagged by flake8-print')\n\n# To demonstrate ignoring a specific print statement:\nimport os\nif os.environ.get('DEBUG_MODE', 'False') == 'True':\n    print('Debug message') # noqa: T201","lang":"python","description":"After installing `flake8` and `flake8-print`, save the code above to a file (e.g., `example.py`). Run `flake8 example.py` from your terminal. Flake8 will report T201 errors for the detected `print` statements. The second `print` statement includes a `# noqa: T201` comment to explicitly ignore the `flake8-print` warning on that line."},"warnings":[{"fix":"Migrate your codebase to Python 3.7 or newer. If you need Python 2.7 support, you must use an older version of flake8-print (e.g., <4.0.0).","message":"Python 2.7 support was officially dropped in version 4.0.0. Ensure your project runs on Python 3.7+ before upgrading to or using 4.0.0 and above.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Update any `noqa: T0xx` comments or `flake8` configuration `ignore` lists to use `T2xx` (e.g., `noqa: T201`).","message":"In version 5.0.0, the error code namespace was moved from `T0xx` to `T2xx` (e.g., `T001` became `T201`). Projects relying on specific `ignore` lists or `noqa` comments for `T0xx` codes will need to update them to the new `T2xx` prefix.","severity":"breaking","affected_versions":"5.0.0"},{"fix":"For versions where multiline `noqa` is not fully supported, refactor multiline print statements or use `noqa` on each relevant line if supported for single-line usage. Ensure you are on `4.0.1` or newer for improved `noqa` detection.","message":"Version 3.0.0 introduced a loss of multiline `noqa` support when the checker moved from a logical line checker with regex to an AST-based approach. While `2.0.0` supported `noqa` on multiline `print` statements, this was temporarily lost in `3.0.0` and `4.0.1` had a fix related to `noqa` detection.","severity":"breaking","affected_versions":">=3.0.0, <4.0.1 (partially)"},{"fix":"Consult `flake8` documentation and `flake8-print` error codes for precise `noqa` usage. Use `# noqa: T201` for a `print` statement, `# noqa: T203` for a `pprint` statement.","message":"Incorrect or incomplete `noqa` comments. To ignore specific `flake8-print` errors, use `# noqa: T201` (for `print` statements) or `# noqa: T203` (for `pprint` statements) at the end of the line. Using just `# noqa` will ignore all `flake8` warnings on that line. Make sure to use the correct `T2xx` error codes from version 5.0.0 onwards.","severity":"gotcha","affected_versions":"All versions, especially >=5.0.0 for new error codes"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}