+ 1
What a var __debug__?
what is it? why it True
1 Antwort
+ 3
It's True on SoloLearn, which is the value when Python was started *without* an "O" option.
From the documentation:
https://docs.python.org/3/using/cmdline.html#cmdoption-o
If I understand correctly, starting Python with -O sets __debug__ False and disables all asserts, which seems like a quick way to optimize for production / omit things like debug logging.