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 am working on removing `dict` and `**kwargs` hack from mypy after https://github.com/python/typeshed/pull/8517 is merged. But, I found a very confusing thing in how `*args` and `**kwargs` are checked. Simple...

bug
topic-calls

**Crash Report** I was just trying things out and found a crash with: ```python from dataclasses import dataclass from typing import Final @dataclass class FirstClass: FIRST_CONST: Final = 3 @dataclass...

crash
priority-0-high
topic-final
topic-dataclasses

sorry for the wacky title ```py from typing import TypeVar, Literal from typing_extensions import assert_never Fn = TypeVar("Fn") def foo(fn: Fn, value: bool = False) -> Fn: ... def bar(value:...

bug
topic-reachability

```py from typing import TypeVar, TypeAlias T = TypeVar("T") TAlias: TypeAlias = T def foo( t1: TAlias[int], # no error t2: TAlias, # error: Missing type parameters for generic type...

feature
topic-type-variables
priority-2-low
topic-type-alias

**Bug Report** In some cases (see code below) mypy recognizes type of values in nested dict as `object`. Adding hint with more exact type results in an error. **To Reproduce**...

bug
topic-join-v-union

General, language: - [x] Fix typed_ast support for Python 3.11 (fixed in 1.5.4) - [x] Get tests running (#12833) - [x] Unbreak mypyc (https://github.com/mypyc/mypyc/issues/931) - [x] Fixes for asyncio.coroutine removal...

feature
good-second-issue
meta

We now allow narrowing metaclasses with `issubclass`. Closes https://github.com/python/mypy/issues/11671

**Bug Report** I'm getting inconsistent behavior with Sequence/Iterable/TypedDict/Union. **To Reproduce** Run `mypy` on: ```python from typing import Iterable, Sequence, TypedDict, Union class DictType(TypedDict): a: str # No error below with...

bug

**Bug Report** A an `if` statement like `if x in some_dict.keys()` doesn't narrow the type of `x` to the type of the key of `some_dict`. This is in contrast with...

feature
topic-type-narrowing

**Feature** Allow this: ```python from typing import Protocol, final class Sized(Protocol): len: int @final def __len__(self) -> int: return self.len ``` **Pitch** I get that this is a bit unusual,...

feature
topic-protocols
topic-final