[docs] [issue34464] docs: keywords are special - eg constants.html

Jonathan Fine report at bugs.python.org
Wed Aug 22 15:08:50 EDT 2018


New submission from Jonathan Fine <jfine2358 at gmail.com>:

The identifiers True, False, None and __debug__ are keywords in the language.  For example
>>> __debug__ = __debug__
SyntaxError: assignment to keyword


1. The page constants.html incorrectly says then are in the built-in namespace. Some of them were, once.

2. The list keyword.kwlist does not contain __debug__. (Problem in Lib/keyword.py.)

3. https://docs.python.org/3/reference/datamodel.html for None, NotImplemented, etc.

4. There may be other places that need looking at.

See also: https://github.com/jfine2358/py-jfine2358/blob/master/docs/none-is-special.md

Credit: The __debug__ problem arises from Steve D'Aprano's message

https://mail.python.org/pipermail/python-ideas/2018-August/052917.html
The std lib contains a test that this correctly raises SyntaxError:
def f(*, x=lambda __debug__:0): pass

----------
assignee: docs at python
components: Documentation
messages: 323904
nosy: docs at python, jfine2358
priority: normal
severity: normal
status: open
title: docs: keywords are special - eg constants.html
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34464>
_______________________________________


More information about the docs mailing list