https://github.com/python/cpython/commit/d36f61d8c8825fbc290a74cd7a24ad6b698c00fb
commit: d36f61d8c8825fbc290a74cd7a24ad6b698c00fb
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: sobolevn <[email protected]>
date: 2026-05-12T09:06:58Z
summary:

[3.13] Update mypy to 2.1.0 (GH-149709) (#149713)

Update mypy to 2.1.0 (GH-149709)
(cherry picked from commit b546cc10f5c659344ce3cf49db6d9c92307ed1fc)

Co-authored-by: sobolevn <[email protected]>

files:
M Lib/test/libregrtest/single.py
M Lib/tomllib/mypy.ini
M Tools/build/check_extension_modules.py
M Tools/build/mypy.ini
M Tools/requirements-dev.txt

diff --git a/Lib/test/libregrtest/single.py b/Lib/test/libregrtest/single.py
index 8fc852f86b455c..75fe0d7ad3b4e8 100644
--- a/Lib/test/libregrtest/single.py
+++ b/Lib/test/libregrtest/single.py
@@ -118,7 +118,7 @@ def regrtest_runner(result: TestResult, test_func, 
runtests: RunTests) -> None:
 
 
 # Storage of uncollectable GC objects (gc.garbage)
-GC_GARBAGE = []
+GC_GARBAGE: list[object] = []
 
 
 def _load_run_test(result: TestResult, runtests: RunTests) -> None:
diff --git a/Lib/tomllib/mypy.ini b/Lib/tomllib/mypy.ini
index 1761dce45562a6..f7eeffd575c1c7 100644
--- a/Lib/tomllib/mypy.ini
+++ b/Lib/tomllib/mypy.ini
@@ -12,6 +12,4 @@ pretty = True
 # Enable most stricter settings
 enable_error_code = ignore-without-code
 strict = True
-strict_bytes = True
-local_partial_types = True
 warn_unreachable = True
diff --git a/Tools/build/check_extension_modules.py 
b/Tools/build/check_extension_modules.py
index 668db8df0bd181..d6b0db0684cdae 100644
--- a/Tools/build/check_extension_modules.py
+++ b/Tools/build/check_extension_modules.py
@@ -416,7 +416,7 @@ def get_location(self, modinfo: ModuleInfo) -> pathlib.Path 
| None:
     def _check_file(self, modinfo: ModuleInfo, spec: ModuleSpec) -> None:
         """Check that the module file is present and not empty"""
         if spec.loader is BuiltinImporter:  # type: ignore[comparison-overlap]
-            return
+            return  # type: ignore[unreachable]
         try:
             assert spec.origin is not None
             st = os.stat(spec.origin)
diff --git a/Tools/build/mypy.ini b/Tools/build/mypy.ini
index 13d47b9a2e2013..ed0950166f126f 100644
--- a/Tools/build/mypy.ini
+++ b/Tools/build/mypy.ini
@@ -20,8 +20,6 @@ python_version = 3.10
 
 # ...And be strict:
 strict = True
-strict_bytes = True
-local_partial_types = True
 extra_checks = True
 enable_error_code = 
ignore-without-code,redundant-expr,truthy-bool,possibly-undefined
 warn_unreachable = True
diff --git a/Tools/requirements-dev.txt b/Tools/requirements-dev.txt
index af5cbaa7689f33..46381ea58a1238 100644
--- a/Tools/requirements-dev.txt
+++ b/Tools/requirements-dev.txt
@@ -1,7 +1,7 @@
 # Requirements file for external linters and checks we run on
 # Tools/clinic, Tools/cases_generator/, and Tools/peg_generator/ in CI
-mypy==1.19.1
+mypy==2.1.0
 
 # needed for peg_generator:
-types-psutil==7.2.2.20260130
-types-setuptools==82.0.0.20260210
+types-psutil==7.2.2.20260508
+types-setuptools==82.0.0.20260508

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to