2 ms·
I tried using it, but beartype quickly became a pain with having to decorate things manually. Then I found typeguard which goes even further and never looked ba
by skeledrew 2y ago
I tried using it, but beartype quickly became a pain with having to decorate things manually. Then I found typeguard which goes even further and never looked back. Instead of manually decorating each individual function, an import hook can be activated that automatically decorates any function with type annotation. Massive QoL improvement. I have it set to only activate during testing though as I'm unsure of the overhead.
- Mattwmaster58 2y agoIt looks like beartype supports the same sort of implicit decoration, because there's mention of an explicit API: >Beartype now implicitly type-checks all annotated classes, callables, and variable assignments across all submodules of all packages.
- skeledrew 2y agoThat definitely got implemented after I had already moved on.
- Ey7NFZ3P0nzAe 2y agoIirc beartype is several orders of magnitude faster than typeguard so you might want to give it a try again