mypy
mypy copied to clipboard
Optional static typing for Python
**Bug Report** The presence of `issubclass(...)` in the code sample that follows causes `arg` to take on type `Union[T, Type[object]]`. This change in type leads to false positives, as demonstrated...
**Bug Report** This is probably the same underlying cause as issue #11759, but the proposed workaround there doesn't seem particularly appropriate for the case of `Enum`s and `Literal`s. I'd like...
**Bug Report** When returning a functional-style `Enum` class from a function with the return type `type[Enum]` mypy reports an error. When the created `Enum` class is assigned to a variable...
**Bug Report** I am trying to compile a module with `@final` types. This does not seem possible at the moment with `mypyc`. Actual source: https://github.com/dry-python/returns/blob/master/returns/result.py#L312 **To Reproduce** ```python from typing_extensions...
**Bug Report** Mypy reports errors when using package multipledispatch for overloading functions. **To Reproduce** ``` from multipledispatch import dispatch @dispatch(list, str) def concatenate(a: list, b: str): a.append(b) return a @dispatch(str,...
Mypy forgets type information after a nested if-statement. Small example: class Base: pass class B(Base): def __init__(self): self.args = [] class C(Base): def __init__(self): self.args = [] def check(x: Base):...
**Bug Report** Hello! Happy Friday folks! I am writing as I was hoping someone here might be help with my company's mypy usage. For us, most of the code is...
This PR closes issue https://github.com/python/mypy/issues/16693 and a part of issue https://github.com/python/mypy/issues/17083 Propositional documentation updates for show-error-code-links, which update files command_line.rst and config_file.rst.
**Bug Report** `mypy` reports error where it is not suppose to. **To Reproduce** ```python from typing import * # types MyDict = TypedDict('MyDict', {"a" : int, "b" : str}, total=False)...
```python def f(x: tuple[int, str, *tuple[range, ...]]) -> None: match x: case [1, *ts]: reveal_type(ts) ``` ([Playground](https://mypy-play.net/?mypy=latest&python=3.12&flags=warn-unreachable&gist=6b5dd7f552779d3d72b102bdc42d775b)) Produces no output, and with `--warn-unreachable` on says that line 4 is unreachable....