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

This makes `.value` not accidentally prune out one of its literals! Alternatively (I just realized this now) we could just return the type without `.last_known_value`. I can switch to that...

This makes the enum plugin (e.g. `.name` and `.value`) work on enum `Literal`s. Fixes https://github.com/python/mypy/issues/14092

```py from abc import ABC, abstractmethod from typing import overload class Foo(ABC): @overload # error: An overloaded function outside a stub file must have an implementation @abstractmethod def foo(self, value:...

feature
priority-2-low
topic-overloads

**Feature** Allow ```python f: Callable[[int], int] def f(n): return 42 ``` as an alternative to ```python def f(n: int) -> int: return 42 ``` **Pitch** Currently, the proposed syntax produces...

feature

**Crash Report** **Traceback** ``` main.py:3: error: Name "TypeVarTuple" is not defined [name-defined] main.py:4: error: Variable "__main__.Ts" is not valid as a type [valid-type] main.py:4: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases main.py:5: error: Bad...

crash
topic-type-alias
topic-pep-646

_Note: make sure you run mypy with a cold cache each time if you're trying to repro this bug locally. It seems to not always reproduce if you have a...

bug
topic-developer

_(An earlier version of this post used `TypeAnnotation` rather than `TypeForm` as the initially proposed spelling for the concept described here)_ **Feature** A new special form `TypeForm[T]` which is conceptually...

feature
topic-depends-on-pep-change
meta
topic-type-form

`--namespace-packages` runs into an issue if we import from `__init__.py` explicitly. For instance, given: ``` . └── proj ├── __init__.py └── a.py $ cat proj/__init__.py x: int $ cat proj/a.py...

bug

**Crash Report** There appears to be a caching bug in `mypy 1.2.0 (compiled: yes)`. This started occurring recently after we upgraded from `1.0.0` to `1.2.0`. I am running mypy with...

topic-incremental
crash

**Documentation** As far as I can tell from the docs/google searches/looking through github issues, there isn't guidance on the standard or simplest ways to run mypy in a monorepo of...

documentation