Message162784
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. |
|
Date |
User |
Action |
Args |
2012-06-14 13:20:05 | r.david.murray | set | recipients:
+ r.david.murray, terry.reedy, vstinner, lebigot, eric.araujo, docs@python, Ronan.Lamy, mherrmann.at |
2012-06-14 13:20:05 | r.david.murray | set | messageid: <1339680005.19.0.543112024515.issue12982@psf.upfronthosting.co.za> |
2012-06-14 13:20:04 | r.david.murray | link | issue12982 messages |
2012-06-14 13:20:04 | r.david.murray | create | |
|