__debug__- built-in constant, which, according to docs on constants , does not look like an implementation detail,
When you try to assign it (which is not supported as the state of documents), the following error message is displayed:
>>> __debug__ = False
File "<stdin>", line 1
SyntaxError: assignment to keyword
Apparently, according to the post, this is a keyword, but:
>>> from keyword import kwlist
>>> '__debug__' in kwlist
False
Which seems strange. None, Trueand False, also listed as constants, are contained in kwlist.
Why are there no keywords in the list __debug__?
source
share