[Python-Dev] Assertions

Paul Prescod paulp@ActiveState.com
Tue, 21 Nov 2000 17:56:35 -0800

Tim Peters wrote:
> As a user, though, I don't expect -O to turn off argument verification!
> Same as the Python implementation in these respects:  public API functions
> *always* check their arguments, while some private API functions check only
> in Debug builds (and via the C library's assert() function, as it's a bug in
> the implementation if a private API is misused).

As a user, I don't expect much argument verification from the Python
library at all! C-level verification makes sense because the alternative
is core dumps. That's not acceptable.

For the rare Python-coded function that DOES do argument verification, I
wouldn't have much of an expectation of the affect of "-O" on it
because, like Jeremy, I hardly ever use -O. So maybe the argument is not
worth having -- if nobody ever uses -O then we should always just
balance safety and performance rather than expecting the user to choose
one or the other.

 Paul Prescod