The python documentation defines a global constant named __debug__ :
__debug__
This constant is true if Python was not started with an -O option. See also the assert statement.
I'm using some python library under my production Django site (Apache/WSGI based) which checks this constant before executing debug-only code.To my surprise, that code is being executed in production.
As the Django site was not started via the python command line interperter, I was wondering what controls this __deubg__ constant?