fixed typechecked()

This commit is contained in:
2021-06-01 11:20:00 +02:00
parent a1bda2c0b3
commit f2aa686aa8

View File

@ -8,7 +8,7 @@ def typechecked(func):
def typechecked_call(obj, *args, **kwargs):
type_hints = get_type_hints(func)
del type_hints["return"]
for arg, dtype in zip(args, type_hints):
for arg, dtype in zip(args, type_hints.values()):
arg_type = type(arg)
if dtype != arg_type:
raise TypeError(f"{func} expected to receive input of type {dtype.__name__} but received {arg_type.__name__}")