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

There are bunch of places where we duplicate some parts of code for special logic in member access (such as properties, class methods, descriptors, `__getattr__()`, etc): * The `checkmember.py` itself...

refactoring
needs discussion
priority-0-high
meta

**Bug Report** Having a function that takes `Optional[T]` as an input and returns `T` (A type var) works incorrectly if T is an union. **To Reproduce** ```python from typing import...

bug
topic-join-v-union

**Bug Report** A class inheriting a class with kw_only=True and using a dataclass_transform doesn't recognize kw_only being set, even though in runtime it does not yield an error. Originally found...

bug
topic-dataclass-transform

**To Reproduce** Gist URL: https://gist.github.com/mypy-play/d139ee55a5729d2ec5b63d4ceaeb5a33 Playground URL: https://mypy-play.net/?mypy=latest&python=3.12&gist=d139ee55a5729d2ec5b63d4ceaeb5a33 ```console $ python test_mypy.py header 1 header 2 $ mypy test_mypy.py Warning: --strict-concatenate is deprecated; use --extra-checks instead test_mypy.py:27: error: "__new__" must...

bug

**Bug Report** In our codebase we chose specific way of working with `pytest.mark.parametrize`. It is hard to look at tests which names are autogenerated from parameters list. To improve this...

bug
topic-pep-572

Reported by KotlinIsland in #16609 ```python # mypy: enable-error-code="possibly-undefined" def foo() -> None: a: int print(a) ``` https://mypy-play.net/?mypy=latest&python=3.12&gist=a044519fd87d51e6028a236f02bcb9cb

bug
topic-possibly-undefined

Mypy shows an incorrect error when the same option is twice in an match statement. **To Reproduce** ```python from typing import assert_never from enum import Enum, auto class Medal(Enum): gold:...

bug

**Feature** Note: This is different than #4409 and #6646 which aim to change what is considered "annotated" and which functions are type-checked in the first place. Mypy currently only type-check...

feature

**Bug Report** When attempting to unpack a `tuple` that uses `Unpack`, if you don't use a star target to capture the variadic `tuple` as a `list`, you get the error...

bug

I tried to use `mypy` in `tox`, and despite the `exclude` api, it seems unable to skip the relevant directories. Also, I tried to only use command `mypy src/xxx_service`, but...

bug