mypy
mypy copied to clipboard
Optional static typing for Python
**Feature** File `t.py`: ```python from typing_extensions import TypedDict class Foo(TypedDict): x:int y:int foo: Partial[Foo] = {'x': 1} # reveal_type(foo) -> TypedDict('t.Foo?', {'x'?: builtins.int, 'y'?: builtins.int}) ``` **Pitch** For some uses...
**Bug Report** **To Reproduce** Using python 3.8 and mypy 0.971 with the following setup: ```python from typing import List, TypeVar, Union T = TypeVar("T") def test(A:List[T], B:List[T]) -> List[T]: ret:List[T]...
### Description Fixes #13691 ## Test Plan I think this may be trivial enough to skip formal testing, but happy to defer to the maintainers.
It is decided to release mypy 1.0 in ~two months, as mypy is mature enough for such a milestone. We need to plan this well in advance, so I am...
Fixes #12112. The reason why mypy was crashing with a "Must not defer during final iteration" error in the following snippet: from typing import TypeVar def test() -> None: T...
**Bug Report** Hey, I'm trying to figure out if this mypy output is a bug or if I'm doing something incorrectly. I need to pass a type variable to a...
**Bug Report** In: - #731 - #13297 (not released yet in v0.971) We now support recursive type hints, such as: ```python JSON = Union[Dict[str, 'JSON'], List['JSON'], str, int, float, bool,...
### Description A separate error code for `truthy-function` so it can be enabled by default. Closes #12621
The syntax `some_enum_value in [list_of_values]` should narrow the enum to that list of values. This is a list extension to https://github.com/python/mypy/issues/10915 "support narrowing enum values using == and !=" Unlike...
### Description Closes #10728 Specifying module(s) to check was supported only via CLI, this PR adds the ability to specify a module from a config file. ## Test Plan This...