Skip to content

Bump mypy from 1.20.2 to 2.0.0#12478

Merged
github-actions[bot] merged 25 commits into3.14from
dependabot/pip/3.14/mypy-2.0.0
May 9, 2026
Merged

Bump mypy from 1.20.2 to 2.0.0#12478
github-actions[bot] merged 25 commits into3.14from
dependabot/pip/3.14/mypy-2.0.0

Conversation

@dependabot
Copy link
Copy Markdown
Contributor

@dependabot dependabot Bot commented on behalf of github May 7, 2026

Bumps mypy from 1.20.2 to 2.0.0.

Changelog

Sourced from mypy's changelog.

Mypy Release Notes

Next Release

Mypy 2.0

We’ve just uploaded mypy 2.0.0 to the Python Package Index (PyPI). Mypy is a static type checker for Python. This release includes new features, performance improvements and bug fixes. There are also changes to options and defaults. 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.

Enable --local-partial-types by Default

This flag affects the inference of types based on assignments in other scopes. For now, explicitly disabling this continues to be supported, but this support will be removed in the future as the legacy behaviour is hard to support with other current and future features in mypy, like the daemon or the new implementation of flexible redefinitions.

Contributed by Ivan Levkivskyi, Jukka Lehtosalo, Shantanu in PR 21163.

Enable --strict-bytes by Default

Per PEP 688, mypy no longer treats bytearray and memoryview values as assignable to the bytes type.

Contributed by Shantanu in PR 18371.

New Behavior for --allow-redefinition

The --allow-redefinition flag now behaves like --allow-redefinition-new in mypy 1.20 and earlier. The new behavior is generally more flexible. For example, you can have different types for a variable in different blocks:

# mypy: allow-redefinition
def foo(cond: bool) -> None:
if cond:
for x in ["a", "b"]:
# Type of "x" is "str" here
...
else:
for x in [1, 2]:
# Type of "x" is "int" here
...

... (truncated)

Commits

@dependabot dependabot Bot added the dependencies Pull requests that update a dependency file label May 7, 2026
@dependabot dependabot Bot requested review from asvetlov and webknjaz as code owners May 7, 2026 10:37
@dependabot dependabot Bot added the dependencies Pull requests that update a dependency file label May 7, 2026
@github-actions github-actions Bot enabled auto-merge (squash) May 7, 2026 10:40
@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.20%. Comparing base (4f58585) to head (c9cc36e).
⚠️ Report is 37 commits behind head on 3.14.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             3.14   #12478   +/-   ##
=======================================
  Coverage   98.20%   98.20%           
=======================================
  Files         135      135           
  Lines       47121    47144   +23     
  Branches     2525     2529    +4     
=======================================
+ Hits        46273    46296   +23     
  Misses        671      671           
  Partials      177      177           
Flag Coverage Δ
CI-GHA 98.25% <92.85%> (-0.01%) ⬇️
OS-Linux 98.02% <92.85%> (-0.01%) ⬇️
OS-Windows 95.65% <92.85%> (-0.01%) ⬇️
OS-macOS 97.20% <92.85%> (-0.01%) ⬇️
Py-3.10.11 96.68% <85.71%> (-0.02%) ⬇️
Py-3.10.20 97.16% <85.71%> (-0.02%) ⬇️
Py-3.11.15 97.44% <85.71%> (-0.02%) ⬇️
Py-3.11.9 96.97% <85.71%> (-0.01%) ⬇️
Py-3.12.10 97.04% <80.95%> (-0.02%) ⬇️
Py-3.12.13 97.53% <80.95%> (-0.01%) ⬇️
Py-3.13.13 97.74% <80.95%> (-0.02%) ⬇️
Py-3.14.4 97.79% <80.95%> (-0.02%) ⬇️
Py-3.14.4t 96.82% <80.95%> (-0.02%) ⬇️
Py-pypy3.11.15-7.3.21 96.66% <85.71%> (-0.01%) ⬇️
VM-macos 97.20% <92.85%> (-0.01%) ⬇️
VM-ubuntu 98.02% <92.85%> (-0.01%) ⬇️
VM-windows 95.65% <92.85%> (-0.01%) ⬇️
cython-coverage 38.09% <64.28%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 7, 2026

Merging this PR will not alter performance

✅ 67 untouched benchmarks
⏩ 4 skipped benchmarks1


Comparing dependabot/pip/3.14/mypy-2.0.0 (c9cc36e) with 3.14 (299693b)2

Open in CodSpeed

Footnotes

  1. 4 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on 3.14 (e2d40c7) during the generation of this report, so 299693b was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Bumps [mypy](https://github.com/python/mypy) from 1.20.2 to 2.0.0.
- [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md)
- [Commits](python/mypy@v1.20.2...v2.0.0)

---
updated-dependencies:
- dependency-name: mypy
  dependency-version: 2.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot force-pushed the dependabot/pip/3.14/mypy-2.0.0 branch from 875d9fd to 948c0db Compare May 7, 2026 11:50
Dreamsorcerer and others added 21 commits May 9, 2026 01:36
Updated _writelines method to accept more chunk types.
Updated the 'write' method to accept a Buffer type instead of bytes.
Update _apply_content_transfer_decoding to return bytes.
Comment thread aiohttp/web_request.py Outdated
Comment thread aiohttp/web_request.py Outdated
Comment thread aiohttp/web_request.py Outdated
Comment thread aiohttp/web_request.py Outdated
Co-authored-by: Sam Bull <aa6bs0@sambull.org>
Comment thread aiohttp/multipart.py Outdated
@github-actions github-actions Bot merged commit e635dd0 into 3.14 May 9, 2026
41 checks passed
@github-actions github-actions Bot deleted the dependabot/pip/3.14/mypy-2.0.0 branch May 9, 2026 02:21
@Dreamsorcerer Dreamsorcerer added the backport-3.14 Trigger automatic backporting to the 3.14 release branch by Patchback robot label May 9, 2026
@aio-libs aio-libs deleted a comment from patchback Bot May 9, 2026
@Dreamsorcerer Dreamsorcerer removed the backport-3.14 Trigger automatic backporting to the 3.14 release branch by Patchback robot label May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant