On Wednesday 16 November 2016 16:21, Veek M wrote: > Trying to make sense of that article. My understanding of debug was > simple: > 1. __debug__ is always True, unless -O or -OO > 2. 'if' is optimized out when True and the expr is inlined. > > So what does he mean by: > > 1. 'If you rebind __debug__, it can cause symptoms'
What he means is, "I didn't test this code before running it, and I am wrong." You cannot rebind __debug__. >>> __debug__ = False File "<stdin>", line 1 SyntaxError: can not assign to __debug__ (That's Python 2.5 or better, and maybe even older than that.) -- Steven 299792.458 km/s — not just a good idea, it’s the law! -- https://mail.python.org/mailman/listinfo/python-list