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' 2. 'During module compilation, the same code that handles literals also handles the magic constants ..., None, True, False, and __debug__' 3. 'you'll see that if __debug__: statements are either removed entirely, or use LOAD_CONST to load the compile-time debug constant, while if bool(__debug__): statements use LOAD_GLOBAL to load the value of __debug__.' 4. 'Of course these are guaranteed to be the sameā¦ unless you rebind __debug__' Basically every line in that answer is new to me.. -- https://mail.python.org/mailman/listinfo/python-list