Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 1.04 KB

type-check.md

File metadata and controls

28 lines (19 loc) · 1.04 KB

Type-check

Python offers several type checkers, but one of the most popular and widely used is mypy. It is a classic type checker that covers all the basic needs of a developer. Other popular solutions include pytype from Google and Pyre from Facebook. While pytype can work without type annotations, Pyre is performance-oriented Because it covers all my needs, I only use mypy.

mypy

Usage

To use mypy, simply run the following command:

mypy CODE_LOCATIONS

Configuration

To enable all optional error checking flags in mypy, you can add the following configuration to your pyproject.toml file:

[tool.mypy]
strict = true

Enabling strict will allow mypy to catch more potential issues in your code, helping you write more robust and error-free Python code.