simplify if statements by using walrus operators (#7671)

This commit is contained in:
Mike Fährmann
2025-07-22 18:34:38 +02:00
parent e8b2a496ba
commit a097a373a9
83 changed files with 239 additions and 466 deletions

View File

@@ -49,8 +49,7 @@ class DanbooruExtractor(BaseExtractor):
def items(self):
# 'includes' initialization must be done here and not in '_init()'
# or it'll cause an exception with e621 when 'metadata' is enabled
includes = self.config("metadata")
if includes:
if includes := self.config("metadata"):
if isinstance(includes, (list, tuple)):
includes = ",".join(includes)
elif not isinstance(includes, str):