mypy
mypy copied to clipboard
Optional static typing for Python
**Feature** Example: ```py from collections.abc import Generator from typing import Any from typing_extensions import Self class MyAwaitable: def __await__(self) -> Generator[Any, None, Self]: return self.do_something().__await__() async def do_something(self) -> Self:...
Hi, I discovered an issue about match case statement. If I use match case and match against single variable, then variable's type is inferred correctly in instructions contained within case....
**Bug Report** _(Although there are other issues that allude to this problem, I haven't been able to locate an issue which specifically addresses truthiness where `__bool__()` is defined and `@final`....
**Documentation** Comment at [mypy/main.py#L503C5-L503C5](https://github.com/python/mypy/blob/b995e1620789a3ab2fc5dbcf0698a9077b0f5731/mypy/main.py#L503C5-L503C5) references [missing documentation](https://github.com/python/mypy/wiki/Documentation-Conventions).
**Crash Report** Creating a `TypedDict` with non-literal keys gives `TypedDict() expects a dictionary literal as the second argument`. Attempting to ignore this with `# type: ignore` causes an `AssertionError` if...
**Feature** Apply type narrowing in case of `x is not C` where `x` is of type `Union[type[C], SomethingElse]`, from that union to `SomethingElse` in case when `C` is made `final`....
**Bug Report** mypy gives inconsistent errors with regard to instantiating classes that derive from a common abstract base class when the derived classes are accessed via a list. The errors...
**Bug Report** I have a folder on my project with some python files, when I try to specify mypy to run against it, it returns the message: > There are...
**Bug Report** Similar to #7778, where having a function that returns a decorator inside a class without a self parameter is not possible. **To Reproduce** I have this setup to...
**Feature** In mypy, we can do something like `# type: ignore [error-code]` For some developer tools, we can use some blockwise settings, ex: ``` # fmt: off blabla # fmt:...