This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author r.david.murray
Recipients Ronan.Lamy, docs@python, eric.araujo, lebigot, mherrmann.at, r.david.murray, terry.reedy, vstinner
Date 2012-06-14.13:20:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1339680005.19.0.543112024515.issue12982@psf.upfronthosting.co.za>
In-reply-to
Content
Because:

  1) The __debug__ flag is defined to be process-global.  If you test it in one module, your code should be able to assume that it has the same value in all other modules

  2) python-dev does not support running .pyo code without -O turned on.  In the future it might be the case that -O would actually change the behavior of the running python interpreter such that .pyo code would fail of -O was not on.

So, you can do the rename or importer trick if you want, and it will work right now as long as your program does not depend on __debug__ being globally consistent (which would be the case for almost all programs), but we do not guarantee it will continue to work in future versions of Python.
History
Date User Action Args
2012-06-14 13:20:05r.david.murraysetrecipients: + r.david.murray, terry.reedy, vstinner, lebigot, eric.araujo, docs@python, Ronan.Lamy, mherrmann.at
2012-06-14 13:20:05r.david.murraysetmessageid: <1339680005.19.0.543112024515.issue12982@psf.upfronthosting.co.za>
2012-06-14 13:20:04r.david.murraylinkissue12982 messages
2012-06-14 13:20:04r.david.murraycreate