> Can I check in the interpreter if I am running a debug version of > python? I don't mean if __debug__ is set, I want to know if python was > compiled in debug mode.
Python has multiple flavors of debug builds. hasattr(sys, "gettotalrefcount") is only available if Py_REF_DEBUG is enabled. This should be sufficient to detect the most used debug variant. Christian -- http://mail.python.org/mailman/listinfo/python-list