Remove dead or-empty-string in format detection

The \`or \"\"\` in \`\"yaml\" in self.mimetype or \"\"\` was a no-op that
made the logic harder to read. The \`in\` check on mimetype already
returns a bool — \`or \"\"\` just evaluates to that bool.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-12 18:09:21 -04:00
parent 52896c6040
commit 79c32fcef4
+2 -2
View File
@@ -308,8 +308,8 @@ class Request:
"""
if format is None:
format = "yaml" if "yaml" in self.mimetype or "" else "json" # noqa: A001
format = "form" if "form" in self.mimetype or "" else format # noqa: A001
format = "yaml" if "yaml" in self.mimetype else "json" # noqa: A001
format = "form" if "form" in self.mimetype else format # noqa: A001
formatter: Callable
if isinstance(format, str):