DEV Community

Discussion on: 5 common beginner mistakes in Python

Collapse
 
oscherler profile image
Olivier “Ölbaum” Scherler

Somewhat, yes. However testing a condition and throwing an exception if it’s not met is exactly the kind of tedious task assertions were made to simplify, make easier to write and easier to read. So if you can’t use them in actual production code, it kinda defeats the purpose. Especially in a dynamically typed language where you have to type-check all your arguments.