Message162784
| 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. |
|