diff --git a/apphelpers/utilities/types.py b/apphelpers/utilities/types.py index 8b74ff5..c9a00ca 100644 --- a/apphelpers/utilities/types.py +++ b/apphelpers/utilities/types.py @@ -5,4 +5,4 @@ def is_optional(t) -> bool: - return len(getattr(t, "__args__", [])) == 2 and t.__args__[1] == NoneType + return NoneType in getattr(t, "__args__", ())