FelixTheC / strongtyping

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

Comparison to typeguard #33

Closed alexmojaki closed 4 years ago

alexmojaki commented 4 years ago

This project looks very similar to https://github.com/agronholm/typeguard

If there are differences, maybe point them out in your README?

FelixTheC commented 4 years ago

Thanks for the information. I will have a look.

FelixTheC commented 4 years ago

I used their decorator against my tests and these are the tests that fail.

FAILED test_typing.py::test_use_different_exception - TypeError: type of argu... FAILED test_typing.py::test_use_own_exception - TypeError: type of argument "... FAILED test_typing.py::test_use_str_repr_as_type - NameError: name 'A' is not... FAILED test_typing.py::test_with_type - TypeError: Subscripted generics canno... FAILED test_typing.py::test_with_callable - Failed: DID NOT RAISE <class 'Typ... FAILED test_typing.py::test_mix - AttributeError: args FAILED test_typing.py::test_with_json - Failed: DID NOT RAISE <class 'TypeErr...

But they support other things which I don't support and don't know if I should. And I support type checking for docstrings (in reST format).

Your ideas are welcome.

alexmojaki commented 4 years ago

Cool! Maybe open some issues there and see if there's any easy fixes you can contribute?

I'm not part of that project, it doesn't really affect me either way. I'm just pointing stuff out.