This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author bup
Recipients bup
Date 2019-02-15.12:22:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1550233328.67.0.392552434895.issue36000@roundup.psfhosted.org>
In-reply-to
Content
keyword.py is used by stuff like the idle colorizer to help determine if an identifier is considered a keyword but it doesn't identify __debug__ despite the fact that the parser treats it exactly the same as None, True, and False. I could not find a more recent issue to bring this back up than #34464 and there it was suggested a issue be made so here it is. 

As mentioned on that previous issue, currently keyword.py builds the list automatically by scanning "Python/graminit.c" but since there is no "__debug__" token to be found in that file it doesn't get added to kwlist.

There is a file that groups the keywords True, False, None, and __debug__: ast.c. But there's no reason for it to be that complicated when nothing would break by for example adding on line 54 of keyword.py the statement "kwlist += ['__debug__']?

Actually, I'm interested in knowing why __debug__ is a keyword in the first place. I'm terrible at searching apparently so there might be more but from what I can tell, the only thing the docs have to say about __debug__ really is the following tautology: "The value for the built-in variable [__debug__] is determined when the interpreter starts."
History
Date User Action Args
2019-02-15 12:22:08bupsetrecipients: + bup
2019-02-15 12:22:08bupsetmessageid: <1550233328.67.0.392552434895.issue36000@roundup.psfhosted.org>
2019-02-15 12:22:08buplinkissue36000 messages
2019-02-15 12:22:08bupcreate