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

**Feature** When the implementation adds new arguments (or the stubs forget some of the arguments), stubtest creates many errors if the new/forgotten argument isn't the last argument. ```py $ cat...

feature
topic-stubtest

The test looks like this: ``` from typing import Mapping class MappingSubclass(Mapping[str, str]): pass def f(**kwargs: 'A') -> None: pass d = None # type: MappingSubclass f(**d) class A: pass...

bug

**To Reproduce** ```py from typing import Literal def fun(**kwargs) -> None: ... class A: def __init__(self): self.a: Literal["a"] = "a" def test(self) -> None: return fun(**{self.a: "a"}) # error: Keywords...

bug
topic-literal-types
topic-calls

**Bug Report** ```py from typing import Any def func(d: dict[int, Any]) -> None: x: int | None x = d.get(1) reveal_type(x) # typing is lost -> Union[Any, None] ``` `d.get`...

bug

When `type[type]` is used inside `reveal_type()` i get `Value of type "Type[type]" is not indexable` error: ```py reveal_type(type[type]) # Value of type "Type[type]" is not indexable # Revealed type is...

bug
false-positive
topic-pep-585

Given that `PYTHONPATH` contains `.../pythonX.Y/site-packages` And a package that contains some private 3rd party stubs under `.../pythonX.Y/site-packages/foo/some_stubs` When setting `MYPYPATH` to `.../pythonX.Y/site-packages/foo/some_stubs` Then `mypy` gives the error `.../pythonX.Y/site-packages is in...

needs discussion
topic-usability

I went for the smallest possible diff in this feature. There are couple of other options I did not want to go with: - `class LiteralStringType` and using it in...

Checking optional attributes in a class does not persist in a nested if: (test.py) ```python #!/usr/bin/env python3 import typing class Example: def __init__(self): self.a: typing.Optional[int] def check_class(foo: Example, bar: Example):...

bug
topic-type-narrowing

It would be nice to display the class that defines the attribute when we assign an incompatible value to an attribute: ``` class A: a = 1 class B(A): a...

feature
priority-1-normal
topic-usability
good-first-issue

Consider this example: ```py x: int = 1 class X(x.__class__): # Name "x.__class__" is not defined # Class cannot subclass "__class__" (has type "Any") pass ``` `Name "x.__class__" is not...

bug
topic-runtime-semantics