Assertions are bad, m'kay?

Dan Stromberg drsalists at gmail.com
Fri Mar 7 19:15:36 EST 2014


On Fri, Mar 7, 2014 at 3:11 AM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:

>
> Assertions are not bad! They're just misunderstood and abused.

> You should read this guy's blog post on when to use assert:
>
> http://import-that.dreamwidth.org/676.html

Nice article.

BTW, what about:

if value >= 3:
   raise AssertionError('value must be >= 3')

?



More information about the Python-list mailing list