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

Current `typeshed` produces: ``` error: ast.Bytes metaclass missmatch Stub: at line 16 Missing metaclass Runtime: at line 513 in file /Users/sobolev/.pyenv/versions/3.8.9/lib/python3.8/ast.py Exiting metaclass: error: ast.Ellipsis metaclass missmatch Stub: at line...

```py a: object if isinstance(a, list): reveal_type(a) # list[Any] b = a[0] # Any ``` Why is `a` narrowed to `list[Any]`? It should be narrowed to `list[T_co]` where `T_co =...

bug
topic-type-narrowing

```py a = [] # main.py:1: error: Need type annotation for "a" (hint: "a: List[] = ...") a.extend(a for a in [1]) reveal_type(a) # main.py:3: note: Revealed type is "builtins.list[Any]"...

feature

**Crash Report** Using a dynamically created class in a match statement produces a warning about it not being a type. If the match also has `*rest` clause mypy crashes. **Traceback**...

crash
topic-match-statement

```py from typing import overload @overload def f(x: object): ... @overload def f(x: int = ...): ... def f(x: object = ""): ... ``` While this code is type-safe, it's...

bug

**Bug Report** ### Discussed in https://github.com/python/typing/discussions/1235 Originally posted by **adam-grant-hendry** August 4, 2022 Related to [this SO question](https://stackoverflow.com/questions/53017505/mypy-method-definition-is-incompatible-with-definition-in-base-class), I'm trying to understand why - [this doesn't yield errors](https://mypy-play.net/?mypy=latest&python=3.8&gist=103fe953e90ce3b1f7bd09ef3a3c6297) but -...

bug

### Description Closes #9408 (and duplicates, e.g. #10585, #11108). Related tracking issue: #11753 Allows unpacking of TypedDicts into other TypedDicts: ``` class Foo(TypedDict): a: int class Bar(TypedDict): a: int b:...

**Feature** Add the ability for mypy to discover the path of "editable" packages installed with _direct_url.json_ files, as described in [PEP-610](https://www.python.org/dev/peps/pep-0610/). **Pitch** As the Python ecosystem continues to move toward...

feature
needs discussion
topic-pep-561

```py class FooMetaclass(type): pass class Foo(metaclass=FooMetaclass): pass fm: FooMetaclass reveal_type(fm) # note: Revealed type is "__main__.FooMetaclass" if issubclass(fm, Foo): reveal_type(fm) # note: Revealed type is "__main__.FooMetaclass" ``` https://mypy-play.net/?mypy=master&python=3.10&gist=d03a0fb47ada04cb3e352ed13fc0f58b

bug
topic-type-narrowing
topic-metaclasses

**Feature** I don't know enough to say whether this is a mypy request or a typing module request... but I find myself doing this pattern to avoid the error `TypedDict...

feature
topic-typed-dict
topic-type-narrowing