mypy
mypy copied to clipboard
Optional static typing for Python
See https://github.com/python/mypy/pull/12214 Currently, stubtest will not ensure that `__all__` is present in the stub if it is present at runtime. We will always check whether the stub has the symbols...
### Description As has been pointed out in https://github.com/python/typeshed/pull/7475, the current typeshed definitions for various async methods in the stub for `typing` are problematic. Until recently, these were all "synchronous"...
**Bug Report** I have a file with _some_ types defined (that I can't modify), and want to create a stub for this file so that I can fill out the...
I received this bug report from a pyright user: https://github.com/microsoft/pyright/issues/2274. Mypy exhibits the same behavior, so I'm wondering whether it's a bug or the intended behavior. In this code sample,...
## Motivation If a variable is unknown / the function node deferred, `mypy` should not emit `Implicit return in function which does not return` or `Missing return statement` errors. Assume...
For the code below (Python 3.7.1) mypy 0.650 improperly reveals types of expressions: (float/int multiplied/divided by the sum(arg)), where arg is Iterable[complex] and generates false positive errors for the type...
`n : Number = 5 ` produces `test_compiler.py:18: error: Incompatible types in assignment (expression has type "int", variable has type "Number")` Which it probably shouldn't because isinstance(n, Number) == True
I'm sorry for abusing the issue tracker, but I'm not sure how else to notify someone who could perform a code-review (I did try pinging/mentions). And no worries of course...
**Bug Report** mypy cannot detect class attribute change if assert but modified in external call This is a case found when I'm trying to check the close status first, and...
mypy 0.620, `--strict`. Sample code: ```python3 import abc from dataclasses import dataclass @dataclass # error: Only concrete class can be given where "Type[Abstract]" is expected class Abstract(metaclass=abc.ABCMeta): a: str @abc.abstractmethod...