mypy
mypy copied to clipboard
Optional static typing for Python
**Bug Report** (A clear and concise description of what the bug is.) Mypy complains duplicate module error when `build` directory is not excluded. ``` package/__init__.py: error: Duplicate module named "package"...
Follow up to #15430 — would've made https://github.com/python/mypy/pull/15566#issuecomment-1616170947 unnecessary.
**Bug Report** When I use stubgen to generate stub file for a pybind11 module ```cpp klass .def_static("some_static_method", &A::some_static_method, R"#(None)#", py::arg("a"), py::arg("b") ); ``` where `pybind11::class_ klass` is bound to C++...
**Bug Report** A `Callable` type alias is handled like usual generic, not as `Callable`. This does not allow to define a type alias for a decorator. It can be handled...
This issue is very similar to #12744, and I've found two of our checkouts that can reproduce this one with dmypy 1.0.0, steps are below 1. Python 3.10.0 on this...
Fixes #12441 Edit: Also fixes #9986
Mypy crashes with a simple script (valid or not) when using `TypeVarTuple` feature. Python 3.11.3, Mypy 1.4.1. ``` $ cat ann.py import typing as tp Ts = tp.TypeVarTuple('Ts') def f(x:...
```toml [tool.mypy] files = ["."] ``` ``` 👉 mypy -c 1 usage: mypy [-h] [-v] [-V] [more options; see below] [-m MODULE] [-p PACKAGE] [-c PROGRAM_TEXT] [files ...] mypy: error:...
**Bug Report** We have several protocols we use to define `@model_validator` in Pydantic V2, see [here](https://github.com/pydantic/pydantic/blob/b11c6255c852ee0cb83db6a3c76313cd8196e1d0/pydantic/functional_validators.py#L339-L484). The problem is that the simplest use case fails. See below: **To Reproduce** ```python...
**Bug Report** Apologies if this has already been reported, but I couldn't find an existing issue for it. The issue I'm seeing is related to accessing the `.value` of an...