3 ms·
It makes sense I guess mostly if Python doesn't have good third party library typechecking... But how would beartype catch it? I mean a runtime error is a runti
by throwaway290 1y ago
It makes sense I guess mostly if Python doesn't have good third party library typechecking... But how would beartype catch it? I mean a runtime error is a runtime error... You trade one for another?
- Ey7NFZ3P0nzAe 1y agoBeartype does not catch errors, it checks before they happen. Basically it's pure python ultra optimized code that calls "isinstance(a, b)" all the time everywhere. If there is a mismatch it crashes. Note that you can also set it to warn instead of crash.