mypy icon indicating copy to clipboard operation
mypy copied to clipboard

Optional static typing for Python

Results 1055 mypy issues
Sort by recently updated
recently updated
newest added

In this example ```python def func(cls: type) -> typing.Any: if cls is str: reveal_type(cls) return cls(5) ``` mypy states > note: Revealed type is "builtins.type" Makes sense. However, if I...

bug
topic-type-narrowing

This is an attempt to fix the attrs magic attribute handling. The attrs magic attribute functionality was added by me a few months ago, but inexpertly. Since we're starting to...

### Description This PR adds minimum token permissions for the GITHUB_TOKEN in GitHub Actions workflows using https://github.com/step-security/secure-workflows. The GitHub Actions workflow has a GITHUB_TOKEN with write access to multiple scopes....

**Feature** A function such as `pandas.read_csv` has many arguments - there are many ways in which a stub file can be incompatible with the implementation :) As far as I...

feature
topic-stubtest

**Bug Report** After upgrading to mypy 0.971 I am not longer getting any error messages, I suspect this is related due to virtualenv issues as our CI (that does not...

bug

**Bug Report** (A clear and concise description of what the bug is.) When generating stub for a C extension, the doctest blocks are parsed and creates a wrong overload. Example...

bug
topic-stubgen

**Bug Report** ParamSpec feature doesn't seem to work well when used with Protocol. **To Reproduce** ```python from typing import Any, ParamSpec, Protocol P = ParamSpec("P") class Runnable(Protocol[P]): def run(self, *args:...

bug
topic-protocols
topic-paramspec

Since we're starting to plan a 1.0 release, I'm taking the opportunity to do a pass over the mypy docs. Some overarching goals include: - Increase consistency. It's pretty common...

feature
documentation

In version 0.630 and `master` (with Python 3.7.0), I get this error : ```py def foo() -> None: global myglobal myglobal = 2 # error: Name 'myglobal' is not defined...

bug
priority-1-normal
false-positive
topic-runtime-semantics
topic-variable-scope

**Bug Report** If the first 2 entries of `sys.path` are pwd, `mypy` seems to miss type checks in imported modules. **To Reproduce** `mypy==0.971` ``` python # sscce.py import sys import...

bug