mypy
mypy copied to clipboard
Optional static typing for Python
See https://github.com/python/typing-council/issues/11
I get a spurious `top/fid/yod.py:6: error: "File" both defines "__slots__" and is used with "slots=True" [misc]`. Similar to https://github.com/python/mypy/issues/11821 / https://github.com/python/mypy/issues/11827, but a more involved repro. I found it not...
**Bug Report** This is admittedly a fairly niche use-case, but this came up when adding more precise type hints to `itsdangerous` and trying to write a `Protocol` that accepts any...
**Crash Report** mypy crashes when it encounters an overload signature containing a TypeVarTuple like: ``` @overload def cast( self, typ: type[MyType[SomeOtherTypeVar, *TheTupleTs]] ) -> MyType[SomeOtherTypeVar, *TheTupleTs]: ... ``` **Traceback** ```...
**Bug Report** On mypy 1.9.0, this code suggests, somewhat nonsensically, `__enter__` because `__aiter__` does not exist despite the reference to `__aiter__` being entirely implicit in the async for loop: ```python...
**Bug Report** I've been having the issue that Mypy suddenly no longer type checks the contents of my imports, even though they are in the same source tree. After bisecting...
Required for https://github.com/python/typeshed/pull/11662 Discussion: https://discuss.python.org/t/allow-self-binding-for-generic-paramspec/50948
**Bug Report** If I don't put any `Any` (and don't import anything with `Any`), there shouldn't be any `Any` . But if I use `isinstance` to narrow to a generic,...
Mypy crashes on `loop.run_in_executor` with the message "Parameters cannot be constrained to" (A clear and concise description of what the bug is.) Run `mypy aio_processes.py` aio_processes.py: ```python import asyncio import...
```python from collections.abc import Callable from typing import Literal, TypeVar, Generic from typing_extensions import assert_never T = TypeVar("T") def doit_if(t: T, fn: Callable[[T], Literal[1, -1]]) -> None: result = fn(t)...