Clarity vs. code reuse/generality

Pablo Torres N. tn.pablo at gmail.com
Sat Jul 4 11:26:15 EDT 2009


On Sat, Jul 4, 2009 at 10:05, kj<no.email at please.post> wrote:
>>http://docs.python.org/reference/simple_stmts.html#grammar-token-assert_stmt
>>"The current code generator emits no code for an assert statement when optimization is requested at compile time."
>
> Sorry, this doesn't say anything like "don't use assertions to test
> argument values".  I'm aware of the fact that assertions are silenced
> under certain circumstances.  But where does the principle 1. in
> your first reply come from?  I've never seen it before, and would
> like to understand the reasoning behind it.
>
> kj
> --
> http://mail.python.org/mailman/listinfo/python-list
>

But...if no code is generated for assertions on some occasions, then the
parameters would go unchecked, potentially breaking your code in said
occasions.

-- 
Pablo Torres N.



More information about the Python-list mailing list