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

**Bug Report** Mypy appears not to consider `ImportError` to be an exception type in some cases. **To Reproduce** ```python y = [ # ValueError, ImportError, # error: List item 0...

bug
topic-inference

The mypy plugin interface is experimental, unstable, and prone to change. In particular, there are no guarantees about backwards compatibility. Backwards incompatible changes may be made without a deprecation period....

documentation
topic-developer
topic-plugins

Fixes [#14428](https://github.com/python/mypy/issues/14428) Similar to https://github.com/python/mypy/pull/9203, this PR exposes a way for `stubgen` to receive a Mypy configuration file with extra options, which allows it to use custom plugins.

topic-stubgen

**Bug Report** mypy is unable to correctly disambiguate a union when there is a dependent function type. The call `meow(s)(s)` is always valid as `s` is either `int` or `str`...

bug
topic-type-narrowing

**Bug Report** When taking the `and` of multiple isinstances/typeguards, it seems like only the most recent is used to constrain the variable whose type is being checked. **To Reproduce** See...

bug
topic-union-types
topic-type-narrowing

This format allows editors and terminals that support linking to specific lines in files to go directly to the right line. Before: ![image](https://user-images.githubusercontent.com/1350584/212081816-d99fa8d9-d98b-4c4b-8b3a-02dda4979cb4.png) ![image](https://user-images.githubusercontent.com/1350584/212081929-a1aa8ab3-f730-4c02-9068-b757d4e93c9d.png) After: ![image](https://user-images.githubusercontent.com/1350584/212082039-77b08140-c780-4a45-b0b3-eb3768d8b994.png) ![image](https://user-images.githubusercontent.com/1350584/212082108-c5ae6950-9c69-44ac-b403-61515b9e2ce5.png)

topic-stubtest

I have a class which is generic and has some runtime marker for determining the underlying type. I would like to use that marker to guide MyPy in validating the...

bug

Fixes #11925 This avoids mypy from guessing subtype relationships because of the any fallback over here: https://github.com/python/mypy/blob/e1bfb75ed2187db76d51ed875ce953da3ba4d02c/mypy/subtypes.py#L438

upnext

**Bug Report** Accessing a property typed to the object we access , e.g. a property defining `__get__(self, obj: B, ...)` through a `Union[A,B]` complains that the argument to `__get__` has...

bug

A TODO I found while looking at something else got me down this rabbit hole, and I noticed mypy's subpar performance in these two cases. Short descriptions from *before* I...

topic-typeguard
upnext