Re: Anything equivalent to cassert in C++?

2009-11-27 Thread Bruno Desthuilliers
Jean-Michel Pichavant a écrit : (snip) I personally never use asserts in python, cause I will end up handling with asserts what I should in fact handle properly in what you call the production code. Not the same concern. Assertions are here for 1/ documention of expected state / value /

Re: Anything equivalent to cassert in C++?

2009-11-27 Thread Jonathan Hartley
On Nov 26, 6:08 pm, Jean-Michel Pichavant jeanmic...@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

Re: Anything equivalent to cassert in C++?

2009-11-26 Thread Aahz
In article mailman.580.1258492799.2873.python-l...@python.org, Peng Yu pengyu...@gmail.com 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

Re: Anything equivalent to cassert in C++?

2009-11-26 Thread Jean-Michel Pichavant
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

Re: Anything equivalent to cassert in C++?

2009-11-26 Thread Lie Ryan
Jean-Michel Pichavant 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

Re: Anything equivalent to cassert in C++?

2009-11-26 Thread Grant Edwards
On 2009-11-26, Jean-Michel Pichavant jeanmic...@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

Re: Anything equivalent to cassert in C++?

2009-11-26 Thread MRAB
Grant Edwards wrote: On 2009-11-26, Jean-Michel Pichavant jeanmic...@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

Anything equivalent to cassert in C++?

2009-11-17 Thread Peng Yu
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

Re: Anything equivalent to cassert in C++?

2009-11-17 Thread Simon Forman
On Tue, Nov 17, 2009 at 4:19 PM, Peng Yu pengyu...@gmail.com 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