Anything equivalent to cassert in C++?

Grant Edwards invalid at invalid.invalid
Thu Nov 26 19:58:12 CET 2009


On 2009-11-26, Jean-Michel Pichavant <jeanmichel at sequans.com> wrote:
> Peng Yu wrote:
>> There are some assertion code (testing if a condition is false, if it
>> is false, raise an Error object) in my python, which is useful when I
>> test my package.  But such case would never occur when in the produce
>> code. If I keep them in if statement, it will take some runtime. I'm
>> wondering what is the practice that take care of the assertion code in
>> python.
>
> Would never occur? You can't use 'would' and 'never' in the
>same sentence.

Why not?  "Would never" is a very common English phrase, and
the OP used it correctly.




More information about the Python-list mailing list