gfrd/egfrd — Issue #58: __debug__ is a "constant" python variable
Author: Jintram
Created: 2012-02-01 13:23:40+00:00
State: open

We're using the variable __debug__ to decide whether to perform checks or not in the algorithm.

This is a rather inconvenient choice, as __debug__ is a constant, which only changes if you start python with the -O option. See also http://docs.python.org/library/constants.html.

__debug__¶

This constant is true if Python was not started with an -O option. See also the assert statement.

Note

The names None and __debug__ cannot be reassigned (assignments to them, even as an attribute name, raise SyntaxError), so they can be considered “true” constants.

Changed in version 2.7: Assignments to __debug__ as an attribute became illegal.