comparison roundup/rest.py @ 8205:4993e122235e

chore(ruff): suppress combine branches with one or expression I want to keep the comment on datetime and expressing the whole thing as on big or statement would prevent that. Also it reads better since I can't get formatting of multiple or statemnts to occur one element per line. if (a or b or c or ...): wants to be reformated to (a or b or ...)
author John Rouillard <rouilj@ieee.org>
date Wed, 11 Dec 2024 15:18:36 -0500
parents 85d2a04e208a
children 8656bd1cf1f1
comparison
equal deleted inserted replaced
8204:85d2a04e208a 8205:4993e122235e
2643 # can handle 2643 # can handle
2644 import numbers 2644 import numbers
2645 import collections 2645 import collections
2646 for key, val in output['error'].items(): 2646 for key, val in output['error'].items():
2647 if isinstance(val, numbers.Number) or type(val) in \ 2647 if isinstance(val, numbers.Number) or type(val) in \
2648 (str, unicode): 2648 (str, unicode): # noqa: SIM114
2649 pass 2649 pass
2650 elif hasattr(val, 'isoformat'): # datetime 2650 elif hasattr(val, 'isoformat'): # datetime # noqa: SIM114
2651 pass 2651 pass
2652 elif type(val) is bool: 2652 elif type(val) is bool: # noqa: SIM114
2653 pass 2653 pass
2654 elif isinstance(val, dict): 2654 elif isinstance(val, dict): # noqa: SIM114
2655 pass 2655 pass
2656 elif isinstance(val, collections.Iterable): 2656 elif isinstance(val, collections.Iterable): # noqa: SIM114
2657 pass 2657 pass
2658 elif val is None: 2658 elif val is None:
2659 pass 2659 pass
2660 else: 2660 else:
2661 output['error'][key] = str(val) 2661 output['error'][key] = str(val)

Roundup Issue Tracker: http://roundup-tracker.org/