3 ms·
This is really useful. I've been coding python projects for a few years now and was never quite sure how/when to use them. You'd run into assert when unit test
by euphemize 13y ago
This is really useful. I've been coding python projects for a few years now and was never quite sure how/when to use them. You'd run into assert when unit testing, but not that much elsewhere. This makes it clearer, I like this quote : Don't use assert for checking anything that you expect might fail in the ordinary use of your program. Assertions are for extraordinary failure conditions.