mypy
mypy copied to clipboard
Optional static typing for Python
Command line tests in `test-data/unit/cmdline.test` are very slow since they use full typeshed stubs and run mypy in a subprocess. It looks like many of them would be easy to...
Fixes #8874 . When raising an error involving passing ```**kwargs```, this PR adds a note informing the user of a potential fix based on @JukkaL's [suggestion](https://github.com/python/mypy/issues/8874#issuecomment-1186134745). For example, ``` main:3:...
**Bug Report** I am using Stubgen to type my files. Here, I have a class with a lot of instance attributes. They are all declared within the `__init__` method. They...
**Crash Report** Mypy Daemon crashed attempting to generate type suggestions for `__reduce__` function in class with nonstandard `__new__`. (re-creating #15823) **Traceback** ``` dmypy suggest crash.py:64: error: INTERNAL ERROR -- Please...
**Bug Report** I'm getting an "Invalid self argument ... to attribute function" error when inheriting and simultaneously augmenting the TypeVarTuple. The error happens only when calling attribute functions, and not...
[It's difficult to believe this hasn't been reported before, but, with apologies, I haven't been able to find an open issue describing this.] **Bug Report** Mypy doesn't support using `@property`...
**Bug Report** Applying `TypeIs` to narrow type of an iterable results in too optimistic reachability analysis. **To Reproduce** ```python from collections.abc import Iterable from typing_extensions import TypeIs def is_iterable_int(val: Iterable[object])...
When I run mypy on the following code: ```py from types import MethodType from typing import Callable def describe(func: Callable[[], None]) -> str: if isinstance(func, MethodType): return 'bound method' else:...
Reopened from #7845 as requested mypy seems to ignore the ``@final`` decorator when it is applied to a TypedDict. This issue becomes material when one invokes the items() or values()...
I noticed something really weird about callback protocols. Consider the following example: ```python from typing import TypeVar, Protocol T = TypeVar("T") class MyCallable(Protocol[T]): __name__: str def __call__( self, __arg: T,...