mypy
mypy copied to clipboard
Optional static typing for Python
Here's a simple example of this bug: ```python # runtime implementation class A(type): def method(self) -> None: print('a') class B(metaclass=A): ... # This works: # B.method() ``` And: ```python #...
Mypy's type checking works well in many cases, but there are some complex cases that are difficult to code for, and would be impossible or costly to check at runtime....
**Bug Report** dmypy ignores flags and config file https://github.com/python/mypy/pull/11396#issuecomment-1048483794 > @sehyun-hwang This seems like a dmypy bug. It seems that dmypy ignores cli flags or config file flags in certain...
I am working on a project which makes heavy use of Mypy AST trees/nodes. and it would be nice if there was less boilerplate when doing pattern matching against nodes...
**Bug Report** mypyc can compile a parameterized dataclass, but it fails at import. **To Reproduce** 1. Make a file with ```python from __future__ import annotations from dataclasses import dataclass from...
Python version: 3.5.2 mypy version: 0.630 Bug of Feature request: Feature Request ---- When defining a class with `__slots__` mypy complains that the instance has no attribute, even if it...
**Bug Report** Given a stub like so: ```python from abc import ABCMeta class Y(metaclass=ABCMeta): ... class Z: foo: type[Y] ``` And a runtime like so: ```python from abc import ABCMeta...
With the following example: ```python from typing import Literal dest: Literal["tata", "tutu"] for src in "tata", "tutu": dest = src ``` I'm getting: error: Incompatible types in assignment (expression has...
**Bug Report** Mypy gives `arg-type` error when calling `map` with `sorted` as the mapping function. **To Reproduce** ``` x = list(map(sorted, [[1, 3, 2], [2, 5, 4, 0]])) assert x...
Regression in `0.920` / `0.930` compared with `0.910`. ```py from typing import Any def func() -> Any: ... var = func() reveal_type(var) # Any assert isinstance(var, bool) reveal_type(var) # bool...