From a25b3e797c9908fc1d6b3c155306ba126e4cde65 Mon Sep 17 00:00:00 2001 From: liamhuber Date: Thu, 9 Jan 2025 09:29:49 -0800 Subject: [PATCH] Drop the private type hint It was necessary for python<3.10, but we dropped support for that, so we can get rid of the ugly, non-public hint. Signed-off-by: liamhuber --- pyiron_workflow/type_hinting.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pyiron_workflow/type_hinting.py b/pyiron_workflow/type_hinting.py index 28af408b..66ae0ce2 100644 --- a/pyiron_workflow/type_hinting.py +++ b/pyiron_workflow/type_hinting.py @@ -28,15 +28,9 @@ def valid_value(value, type_hint) -> bool: def type_hint_to_tuple(type_hint) -> tuple: - if isinstance( - type_hint, - types.UnionType | typing._UnionGenericAlias, # type: ignore - # mypy complains because it thinks typing._UnionGenericAlias doesn't exist - # It definitely does, and we may be able to remove this once mypy catches up - ): + if isinstance(type_hint, types.UnionType): return typing.get_args(type_hint) - else: - return (type_hint,) + return (type_hint,) def type_hint_is_as_or_more_specific_than(hint, other) -> bool: