Type comments with named default values are not returned.
dangle opened this issue · 1 comments
dangle commented
def test_long_form():
"""Test type hinting with long-form comments."""
zzz ='dswsd'
def func(arg1,
arg2, # type: int
arg3 = zzz, # type: str
arg4 = None # type: str
):
# type: (...) -> bool
pass
> assert get_type_hints(func, globals(), locals()) == {
'return': bool,
'arg2': int,
'arg3': str,
'arg4': str
}
E AssertionError: assert {'arg2': <cla...class 'bool'>} == {'arg2': <clas...class 'bool'>}
E Common items:
E {'arg2': <class 'int'>, 'return': <class 'bool'>}
E Right contains more items:
E {'arg3': <class 'str'>, 'arg4': <class 'str'>}
E Full diff:
E - {'arg2': <class 'int'>, 'return': <class 'bool'>}
E + {'arg2': <class 'int'>,
E + 'arg3': <class 'str'>,
E + 'arg4': <class 'str'>,
E + 'return': <class 'bool'>}