From c23161ebd6c620492b8a275559a63da3f5af1cfb Mon Sep 17 00:00:00 2001 From: Tyler Nadolski <122555266+nadolskit@users.noreply.github.com> Date: Mon, 16 Sep 2024 11:33:30 -0700 Subject: [PATCH] lint --- paperqa/types.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/paperqa/types.py b/paperqa/types.py index fab0566c..447dfb77 100644 --- a/paperqa/types.py +++ b/paperqa/types.py @@ -604,9 +604,8 @@ def repopulate_doc_id_from_doi(self) -> None: if self.doi: self.doc_id = encode_id(self.doi) - def __add__( - self, other: DocDetails | int - ) -> DocDetails: # pylint: disable=too-many-branches + # pylint: disable=too-many-branches + def __add__(self, other: DocDetails | int) -> DocDetails: """Merge two DocDetails objects together.""" # control for usage w. Python's sum() function if isinstance(other, int): @@ -656,9 +655,12 @@ def __add__( # get the latest data if self_value is None or other_value is None: merged_data[field] = ( - # if self_value is 0, it's evaluated as falsy and will fallback to other_value even if other_value is None + # if self_value is 0, it's evaluated as falsy and will fallback, + # to other_value even if other_value is None # 0 is a valid value here - self_value if self_value is not None else other_value + self_value + if self_value is not None + else other_value ) else: merged_data[field] = max(self_value, other_value)