We’ve just uploaded mypy 1.8 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.
Type-checking Improvements
Do not intersect types in isinstance checks if at least one is final (Christoph Tyralla, PR 16330)
Detect that @final class without __bool__ cannot have falsey instances (Ilya Priven, PR 16566)
Do not allow TypedDict classes with extra keywords (Nikita Sobolev, PR 16438)
Do not allow class-level keywords for NamedTuple (Nikita Sobolev, PR 16526)
Make imprecise constraints handling more robust (Ivan Levkivskyi, PR 16502)
Fix strict-optional in extending generic TypedDict (Ivan Levkivskyi, PR 16398)
Allow type ignores of PEP 695 constructs (Shantanu, PR 16608)
Enable type_check_only support for TypedDict and NamedTuple (Nikita Sobolev, PR 16469)
Performance Improvements
Add fast path to analyzing special form assignments (Jukka Lehtosalo, PR 16561)
Improvements to Error Reporting
Don't show documentation links for plugin error codes (Ivan Levkivskyi, PR 16383)
Improve error messages for super checks and add more tests (Nikita Sobolev, PR 16393)
#11140: Fix non-string constants at the top of file being detected as docstrings on Python>=3.8.
#11572: Handle an edge case where sys.stderr{.interpreted-text role="data"} and sys.__stderr__{.interpreted-text role="data"} might already be closed when faulthandler{.interpreted-text role="ref"} is tearing down.
#11710: Fixed tracebacks from collection errors not getting pruned.
#7966: Removed unhelpful error message from assertion rewrite mechanism when exceptions are raised in __iter__ methods. Now they are treated un-iterable instead.
Improved Documentation
#11091: Updated documentation to refer to hyphenated options: replaced --junitxml with --junit-xml and --collectonly with --collect-only.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
- `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
- `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency
- `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions
Bumps the all-dependencies group with 5 updates:
23.12.0
23.12.1
6.92.0
6.92.2
5.13.1
5.13.2
1.7.1
1.8.0
7.4.3
7.4.4
Updates
black
from 23.12.0 to 23.12.1Release notes
Sourced from black's releases.
Changelog
Sourced from black's changelog.
Commits
ec91a2b
Prepare release 23.12.1 (#4124)8fec1c3
Adds paren to deps for hidden extra constraint (#4108)35ce37d
Add new changelog templateUpdates
hypothesis
from 6.92.0 to 6.92.2Commits
6da7c6f
Bump hypothesis-python version to 6.92.2 and update changelog42ad4c4
Merge pull request #3814 from HypothesisWorks/create-pull-request/patch0c6a357
docs and lint tweaks3547340
Update pinned dependencies6a6c1cf
Bump hypothesis-python version to 6.92.1 and update changelog867e56a
Merge pull request #3813 from tybug/json-defaultdict3ee5f1a
nocover 3.12 branch0739659
more explicit definition to make ruff happycc2db94
simlify dict_factory casee9ba14c
move version guard to compat.pyUpdates
isort
from 5.13.1 to 5.13.2Release notes
Sourced from isort's releases.
Changelog
Sourced from isort's changelog.
Commits
c655831
Merge pull request #2214 from PyCQA/version/5.13.2b4335b4
Prepare version 5.13.2c36e43c
Merge pull request #2184 from bp72/issue/2154e38702f
Merge pull request #2213 from davidculley/confine-precommit-to-stagesee8d87f
Add fix for the error found by hypothesis5849ec2
Apply the bracket fix from issue 471 only for use_parentheses=Truedf0e119
confine pre-commit to stages9255bca
Merge pull request #2212 from PyCQA/bugfix/#2211-colors-extra5336d7d
Fix colors extrasUpdates
mypy
from 1.7.1 to 1.8.0Changelog
Sourced from mypy's changelog.
... (truncated)
Commits
3b46750
remove +dev suffix from versionc9bc833
Fix tests broken by hatchling (#16655)60d30e3
Fix crash with type alias toCallable[[Unpack[Tuple[Any, ...]]], Any]
(#16541)f53f422
Allow type ignores of PEP 695 constructs (#16608)7c33e7c
@final
class without bool cannot have falsey instances (#16566)c224da5
Do not intersect types in isinstance checks if at least one is final (#16330)d54cc35
Change example in test cases with no stubs available (#16513)eb1ee97
Update hashes insync-typeshed.py
following recent typeshed sync (#16600)344298e
Revert use ofParamSpec
forfunctools.wraps
3e5d813
Revert typeshed ctypes changeUpdates
pytest
from 7.4.3 to 7.4.4Release notes
Sourced from pytest's releases.
Commits
33f694f
Prepare release version 7.4.476c107c
Merge pull request #11751 from bluetech/backport-11143-to-7.4.x531d76d
[7.4.x] Improve reporting from iter exceptions (#11749)a0f58fa
Merge pull request #11143 from tushar-deepsource/patch-1b1f3387
[7.4.x] #11091: documentation should use hypthonated properties (#11750)2cdd619
Merge pull request #11747 from pytest-dev/backport-11711-to-7.4.xd06c05b
[7.4.x] nodes: fix tracebacks from collection errors are not getting pruned5582bfc
[7.4.x] Improves clarity in Sphinx documentation for function signature. (#11...13024ef
[7.4.x] Fix for operation on closed file in faulthandler teardown (#11631)a40dacf
[7.4.x] XFAIL TestLocalPath.test_make_numbered_dir_multiprocess_safe (#11616)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show