mypy
mypy copied to clipboard
Optional static typing for Python
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...
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...
**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 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 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:...
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...
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 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...