mirror of
https://github.com/kennethreitz/responder.git
synced 2026-06-05 06:46:14 +00:00
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:
+2
-2
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user