]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
⬆️ Update mypy to 1.14.1 (#12970)
authorTamir Duberstein <tamird@gmail.com>
Sat, 20 Sep 2025 12:05:51 +0000 (21:05 +0900)
committerGitHub <noreply@github.com>
Sat, 20 Sep 2025 12:05:51 +0000 (14:05 +0200)
Co-authored-by: Motov Yurii <109919500+YuriiMotov@users.noreply.github.com>
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
Co-authored-by: svlandeg <svlandeg@github.com>
Co-authored-by: svlandeg <sofie.vanlandeghem@gmail.com>
fastapi/encoders.py
fastapi/routing.py
requirements-tests.txt

index 451ea0760f07bc2a70029b99b124883b42a92f9c..0ad548b948ced6a98c16780ab41c3963e1a612a1 100644 (file)
@@ -241,6 +241,7 @@ def jsonable_encoder(
             sqlalchemy_safe=sqlalchemy_safe,
         )
     if dataclasses.is_dataclass(obj):
+        assert not isinstance(obj, type)
         obj_dict = dataclasses.asdict(obj)
         return jsonable_encoder(
             obj_dict,
index 54c75a02737d0328eb9445b2fe502eb0d3b1e2bf..5418ad9826f273f8d4aa2a40caa6d1eff27e400e 100644 (file)
@@ -120,6 +120,7 @@ def _prepare_response_content(
             for k, v in res.items()
         }
     elif dataclasses.is_dataclass(res):
+        assert not isinstance(res, type)
         return dataclasses.asdict(res)
     return res
 
index 7c1fd12f7a152390615753abcd2e2beec742a3d0..e87a42162cd28957ee53183b492679608bebcac8 100644 (file)
@@ -2,7 +2,7 @@
 -r requirements-docs-tests.txt
 pytest >=7.1.3,<9.0.0
 coverage[toml] >= 6.5.0,< 8.0
-mypy ==1.8.0
+mypy ==1.14.1
 dirty-equals ==0.9.0
 sqlmodel==0.0.24
 flask >=1.1.2,<4.0.0