Message161267
I was definitely wrong about the "obvious" part, then. The 'if __debug__:' idiom is completely optimized away by -O, just like asserts are. That is, in -O mode, there is no if test, the code block is just omitted entirely.
Having said that, though, I can't find it documented other than by the implicit equivalence given in the assert docs.
Hmm. Yes, it does seem to be a CPython implementation detail. See issue 8379. Assert being removed is also an implementation detail, though (see the reference to "the current code generator..." in the assert docs). I suppose that '-O' itself is a CPython implementation detail, in a sense :) |
|
Date |
User |
Action |
Args |
2012-05-21 11:55:24 | r.david.murray | set | recipients:
+ r.david.murray, vinay.sajip, serhiy.storchaka, Lluís |
2012-05-21 11:55:24 | r.david.murray | set | messageid: <1337601324.26.0.827967998169.issue14868@psf.upfronthosting.co.za> |
2012-05-21 11:55:23 | r.david.murray | link | issue14868 messages |
2012-05-21 11:55:23 | r.david.murray | create | |
|