From 6ad10841526e7f4c27ef085c65d109b64fb3f7f8 Mon Sep 17 00:00:00 2001 From: Martin Schubert Date: Thu, 30 Nov 2023 15:15:33 -0800 Subject: [PATCH] pre-commit --- src/totypes/json_utils.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/totypes/json_utils.py b/src/totypes/json_utils.py index bb698ad..e393153 100644 --- a/src/totypes/json_utils.py +++ b/src/totypes/json_utils.py @@ -214,9 +214,7 @@ def _convert_array(arr: Union[onp.ndarray, jnp.ndarray]) -> Tuple[str, Dict[str, def _asdict(x: Any) -> Dict[str, Any]: """Converts dataclasses or namedtuples to dictionaries.""" if dataclasses.is_dataclass(x): - return { - field.name: getattr(x, field.name) for field in dataclasses.fields(x) - } + return {field.name: getattr(x, field.name) for field in dataclasses.fields(x)} try: return x._asdict() # type: ignore[no-any-return] except AttributeError as exc: