From c6a87350f02fa407d03e2c8bb606e99afeebf8e4 Mon Sep 17 00:00:00 2001 From: "Felipe S. S. Schneider" <37125+schneiderfelipe@users.noreply.github.com> Date: Mon, 6 Jul 2026 19:20:20 -0300 Subject: [PATCH 1/2] fix: `X | Y` instead of `(X, Y)` in _misc.py (ruff complaint) Signed-off-by: Felipe S. S. Schneider <37125+schneiderfelipe@users.noreply.github.com> --- overreact/_misc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/overreact/_misc.py b/overreact/_misc.py index ab4d9caf..83b98f09 100644 --- a/overreact/_misc.py +++ b/overreact/_misc.py @@ -196,7 +196,7 @@ def make_hashable(obj): """ if isinstance(obj, np.ndarray): return (tuple(obj.shape), tuple(obj.ravel())) - elif isinstance(obj, (list, set)): + elif isinstance(obj, list | set): return tuple(make_hashable(item) for item in obj) else: return obj @@ -235,7 +235,7 @@ def convert_back(arg): shape, flat_data = arg if ( isinstance(shape, tuple) - and all(isinstance(dim, (int, np.integer)) for dim in shape) + and all(isinstance(dim, int | np.integer) for dim in shape) and isinstance(flat_data, tuple) ): if len(flat_data) == 0 or any(dim <= 0 for dim in shape): @@ -873,7 +873,7 @@ def totuple(a): ((2, 2), (2, -2)) """ # we don't touch some types, and this includes namedtuples - if isinstance(a, (int, float, str, rx.Scheme)): + if isinstance(a, int | float | str | rx.Scheme): return a with contextlib.suppress(AttributeError): From 7dd0618cb00081c7555e9a2d4b0fec3671b96c97 Mon Sep 17 00:00:00 2001 From: "Felipe S. S. Schneider" <37125+schneiderfelipe@users.noreply.github.com> Date: Mon, 6 Jul 2026 19:22:28 -0300 Subject: [PATCH 2/2] fix: same as made in _misc.py, but now for io.py Signed-off-by: Felipe S. S. Schneider <37125+schneiderfelipe@users.noreply.github.com> --- overreact/io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/overreact/io.py b/overreact/io.py index d93ec868..8a244f30 100644 --- a/overreact/io.py +++ b/overreact/io.py @@ -950,7 +950,7 @@ def __init__(self, *args, **kwargs) -> None: super().__init__(*args, **kwargs) for key, val in self.items(): - if isinstance(val, (list, np.ndarray)): + if isinstance(val, list | np.ndarray): super().__setitem__(key, rx._misc.totuple(val)) elif isinstance(val, dict): super().__setitem__(key, DotDict(val))