__debug__

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