R. David Murray <rdmur...@bitdance.com> added the comment: 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. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue12982> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com