FelixTheC / strongtyping

Decorator which checks whether the function is called with the correct type of parameters.
https://pypi.org/project/strongtyping/
107 stars 3 forks source link

Wrong repr when using match_class_typing #63

Closed FelixTheC closed 3 years ago

FelixTheC commented 3 years ago

Describe the bug

@match_class_typing
class Foo:

    def __init__(self, val: list = []):
        self.val = val

if __name__ == "__main__":
    print(Foo)

>>> <strongtyping.strong_typing.match_class_typing object at 0x7f97fd033fd0>

but it should be

>>> <class '__main__.Foo'>

The fix: put it inside match_class_typing def repr(self): return repr(self.cls)