From 3c1866474dea4c55d50cff8cc68412326f44377c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Tue, 10 Feb 2026 14:54:40 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Auto=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastapi/encoders.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fastapi/encoders.py b/fastapi/encoders.py index 879def72e..16c90b82b 100644 --- a/fastapi/encoders.py +++ b/fastapi/encoders.py @@ -341,7 +341,11 @@ def jsonable_encoder( ) return encoded_list - if named_tuple_as_dict and getattr(obj, "_asdict", None) is not None and callable(obj._asdict): + if ( + named_tuple_as_dict + and getattr(obj, "_asdict", None) is not None + and callable(obj._asdict) + ): return jsonable_encoder( obj._asdict(), include=include,