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

Now we can narrow `@final` types with `is` and `is not`. Closes #15553

upnext

It would be nice to make a release. It's been about two months since 1.11. We have a couple nice changes in there and it'd be great to release a...

meta

Fixes https://github.com/mypyc/mypyc/issues/1071 Adds a test to cover this case Building certain package layouts now succeeds instead of failing. The behavior for all package layouts not affected by the error is...

``` λ mypy --version mypy 1.11.2 (compiled: yes) λ uv pip show torch Using Python 3.11.8 environment at /Users/shantanu/.virtualenvs/openai-wfht Name: torch Version: 2.1.0 Location: /Users/shantanu/.virtualenvs/openai-wfht/lib/python3.11/site-packages Requires: filelock, fsspec, jinja2, networkx,...

performance

**Bug Report** In 1.11.0, classes that inherit from os.PathLike could be used with `os.path` methods. As of 3.12, these methods claim to accept "any object implementing the [os.PathLike](https://docs.python.org/3.12/library/os.html#os.PathLike) protocol". However,...

bug

**Bug Report** I see there is some work ongoing for adding PEP 695 support. Creating this issue to track support in `stubgen`. **To Reproduce** Run `stubgen` for: ```python type ListOrSet[T]...

feature
topic-stubgen
topic-pep-695

**Bug Report** When decorating an empty method ("`...`") inside of a `Protocol` definition as an `asynccontextmanager`, the type checker insists that the return type must use `Never` instead of allowing...

bug

This PR introduce to mypyc the ability to generate efficient classes passed by value unleashing deeper optimizations in the C generated code. With this change mypyc will be finding immutable...

**Bug Report** > `mypy_arg_type.py`: ``` import numpy as np from numpy.typing import NDArray import random def winner(_: NDArray[np.bytes_]) -> bytes | None: return b"." if bool(random.randint(0, 1)) else None board...

bug