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

I will be cutting the release branch today (truly a January release!) and probably actually release sometime next week. Please comment here if there are any outstanding PRs you wish...

meta

This came up in https://github.com/python/typeshed/pull/6762 ```python from typing import Any, TypeVar, Union T = TypeVar("T") V = TypeVar("V", str, bytes) def check_t(x: T | list[T]) -> T: ... def check_v(x:...

bug
topic-type-variables
affects-typeshed

The implementation turned out to be quite simple for the common cases. Note: Right now there's no check that `type_params=` is correct, I am not sure that this is even...

```py from typing import Generic, TypeVar, _T as T U = TypeVar("U") class A(Generic[T]): def __init__(self, u: U): ... a: A[int] # okay a = A[int]("asdf") # error: Type application...

bug

**Bug Report** mypy incorrectly tags a function argument of type `Mapping[K, V]` where `K` and `V` are `TypeVar` with the return value of the caller function. **To Reproduce** The below...

bug

**Bug Report** This might be a tough one to support...MyPy doesn't understand that if a conditional check is done to determine if one value out of a group of values...

bug

**Bug Report** A Generic class that is a subclass of a class with a `__new__()` declared where there is a `TypeVar` as a parameter of `__new__()` reports that "Type application...

bug

**Bug Report** When there is only one member of the enum, `mypy` doesn't perform full exhaustiveness checking and reaches `assert_never` statement, although it shouldn't. **To Reproduce** [mypy-play link](https://mypy-play.net/?mypy=latest&python=3.12&gist=8c4c845f4b94692acf880b4b99b3e8ce) **Expected Behavior**...

bug
topic-match-statement
topic-reachability

**Feature** Extend `unused-coroutine` to also encompass directly using the unawaited result with if/while, or perhaps also in other instances where it's used as a condition such as boolean operations etc....

feature