from typing import Optional, Tuple
from enforce import runtime_validation
@runtime_validation
def foo(arg: Optional[Tuple[str, str]] = None):
pass
foo()
Yields TypeError: 'NoneType' object is not iterable. Note that the result is the same when the argument has no default value and None is explicitly passed.
Trying to dig-in the source it seems that at some point the None value is propagated to the Tuple node, which might be ok. I will provide a pull request with a fix.
Yields
TypeError: 'NoneType' object is not iterable
. Note that the result is the same when the argument has no default value andNone
is explicitly passed.Trying to dig-in the source it seems that at some point the
None
value is propagated to theTuple
node, which might be ok. I will provide a pull request with a fix.