Hacker News new | ask | show | jobs
by topoloneuron 1670 days ago
Can I use this on my full codebase all at once, without inserting "from beartype import beartype" into each file and decorating every single function and method?
1 comments

I guess you could, near the beginning of your program's entry point, decorate the importlib's functions to decorate the top-level functions of imported modules with "@beartype" decorator.

Or there is always find+grep+sed, if you prefer a different style of madness.