mypy icon indicating copy to clipboard operation
mypy copied to clipboard

Optional static typing for Python

Results 1055 mypy issues
Sort by recently updated
recently updated
newest added

**Feature** `mypy --install-types requirements.txt` will install type stubs of all dependencies in the file. **Pitch** I can't see a generic way to set up an environment ahead of time.

feature
topic-usability
meta

updates: - [github.com/hauntsaninja/black-pre-commit-mirror: 23.3.0 → 23.7.0](https://github.com/hauntsaninja/black-pre-commit-mirror/compare/23.3.0...23.7.0) - [github.com/astral-sh/ruff-pre-commit: v0.0.272 → v0.0.277](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.272...v0.0.277)

I don't know if this is possible, but if it was I think it would be pretty neat. ```python import cProfile import typing as T variable: T.List[str] = [] print(f'{variable=}')...

feature

**Bug Report** When I run mypy==0.991 in parallel, the following error randomly happens. ``` Traceback (most recent call last): File "/home/my_name/.pyenv/versions/3.9.16/bin/mypy", line 8, in sys.exit(console_entry()) File "/home/my_name/.pyenv/versions/3.9.16/lib/python3.9/site-packages/mypy/__main__.py", line 15, in...

crash

**Bug Report** If a class variable is changed in a function after a check, mypy assumes that all variables are still the same. This leads to a comparison-overlap error, where...

bug
topic-overlap

Consider the following (contrived) code: ```python from typing import Type def untyped_function(): return int def foo() -> Type[int]: x = untyped_function() assert issubclass(x, int) return x ``` Running mypy on...

bug
topic-type-narrowing

**Bug Report** The following snippet: ``` from dataclasses import dataclass from asyncio import wait_for @dataclass class A: i: int | None = None async def bar()->tuple[int, int]: return (0,0) async...

bug

- Fixes https://github.com/python/mypy/issues/15037 - Fixes https://github.com/python/mypy/issues/15065 - Fixes https://github.com/python/mypy/issues/15073 - Fixes https://github.com/python/mypy/issues/15388 - Fixes https://github.com/python/mypy/issues/15086 Yet another part of https://github.com/python/mypy/pull/14903 that's finally been extracted!

upnext

**Feature** Add typing support for the following forms of computing `__all__`: ```python __all__ += ['a', b'] __all__ += submodule.__all__ __all__.extend(submodule.__all__) ``` **Pitch** Combining `__all__` from multiple submodules is a common...

feature

Adding optional error flag for missing return type, when a function has at least one typed argument. This will address issue #15127