Bump mypy from 1.10.1 to 1.11.0
Bumps mypy from 1.10.1 to 1.11.0.
Changelog
Sourced from mypy's changelog.
Mypy Release Notes
Next release
Mypy 1.11
We’ve just uploaded mypy 1.11 to the Python Package Index (PyPI). Mypy is a static type checker for Python. This release includes new features, performance improvements and bug fixes. You can install it as follows:
python3 -m pip install -U mypy
You can read the full documentation for this release on Read the Docs.
Support Python 3.12 Syntax for Generics (PEP 695)
Mypy now supports the new type parameter syntax introduced in Python 3.12 (PEP 695). This feature is still experimental and must be enabled with the
--enable-incomplete-feature=NewGenericSyntax
flag, or withenable_incomplete_feature = NewGenericSyntax
in the mypy configuration file. We plan to enable this by default in the next mypy feature release.This example demonstrates the new syntax:
# Generic function def f[T](https://github.com/python/mypy/blob/master/x: T) -> T: ... reveal_type(f(1)) # Revealed type is 'int' Generic class class C[T]: def init(self, x: T) -> None: self.x = x c = C('a') reveal_type(c.x) # Revealed type is 'str' Type alias type A[T] = C[list[T]]
This feature was contributed by Jukka Lehtosalo.
Support for
functools.partial
Mypy now type checks uses of
functools.partial
. Previously mypy would accept arbitrary arguments.This example will now produce an error:
from functools import partial </tr></table>
... (truncated)
Commits
-
dbd5f5c
Remove +dev from version for 1.11 release -
f0a8c69
Update CHANGELOG for mypy 1.11 (#17540) -
371f780
CHANGELOG.md update for 1.11 (#17539) -
2563da0
Fix daemon crash on invalid type in TypedDict (#17495) -
d8c67c3
[release 1.11] Ignore some errors in typeshed (#17510) -
294daff
Mention --enable-incomplete-feature=NewGenericSyntax (#17462) -
5c33abf
Further improvements to functools.partial handling (#17425) -
c37d972
Fix type comments crash inside generic definitions (#16849) -
d39f023
Add changelog entry for 1.10.1 (#17436) -
6c1d867
Fix ParamSpec inference against TypeVarTuple (#17431) - Additional commits viewable in compare view