diff --git a/pydra/utils/tests/test_typing.py b/pydra/utils/tests/test_typing.py index 1c239554da..d192870733 100644 --- a/pydra/utils/tests/test_typing.py +++ b/pydra/utils/tests/test_typing.py @@ -848,7 +848,3 @@ def test_type_is_instance10(): def test_type_is_instance11(): assert not TypeParser.is_instance(None, ty.Union[int, str]) - - -def test_type_is_instance12(): - assert not TypeParser.is_instance((1, None), ty.Tuple[int, None]) diff --git a/pydra/utils/typing.py b/pydra/utils/typing.py index a3e441be1d..644b26cf71 100644 --- a/pydra/utils/typing.py +++ b/pydra/utils/typing.py @@ -672,6 +672,8 @@ def is_subclass( args = get_args(klass) for candidate in candidates: + if candidate is None: + candidate = type(None) candidate_origin = get_origin(candidate) candidate_args = get_args(candidate) # Handle ty.Type[*] types in klass and candidates