types-flask is a PEP 561 type stub package providing static type information for the Flask web framework. It allows type-checking tools like MyPy, PyCharm, and Pyright to analyze code that uses Flask, catching potential type-related errors before runtime. The current version is 1.1.6. It is part of the `typeshed` project, which generally releases updates as needed to align with changes in the runtime libraries it provides stubs for, although its primary function for Flask versions 2.0 and newer has been superseded by Flask's native type annotations.
pip install types-flaskVerified import paths — ran on the pinned version, not inferred.
This minimal Flask application demonstrates basic routing. If you are using Flask version prior to 2.0, `types-flask` would provide type checking for this code. For Flask 2.0 and newer, Flask includes its own type annotations, rendering `types-flask` unnecessary.
Uninstall `types-flask` if you are using Flask 2.0 or a newer version: `pip uninstall types-flask`.
Continue to import symbols directly from `flask` (e.g., `from flask import Flask`), as `types-flask` only provides static type definitions for these existing symbols.
Consult the `typeshed` repository's `stubs/Flask` directory for details on which `flask` versions are supported by specific `types-flask` releases.