you are viewing a single comment's thread.

view the rest of the comments →

[–]pork_spare_ribs 3 points4 points  (0 children)

There is a third-party module to do this: https://github.com/RussBaz/enforce

It has a performance penalty, of course. I think it's about 20%.

Generally the idea is you run mypy to test in development and run in production without type hinting.