[docs] [issue33014] Clarify doc string for str.isidentifier()

Terry J. Reedy report at bugs.python.org
Sat Mar 10 11:53:39 EST 2018


Terry J. Reedy <tjreedy at udel.edu> added the comment:

Part of my reason for closing is that we have an index entry "iskeyword() (in module keyword)"  to help anyone who tries the function as a method.  But I am reopening for 2 reasons:

 1. I think the following is a better improvement that reads better as well as being more informative.  I would be willing to merge it.

"Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as "def" or "class".

2. We should fix the buggy iskeyword docstring in 2.7 and 3.x.

>>> keyword.iskeyword.__doc__
'x.__contains__(y) <==> y in x.'

Replace with the doc entry: "Return true if s is a Python keyword."

----------
resolution: rejected -> 
stage: resolved -> needs patch
status: closed -> open
type:  -> behavior
versions: +Python 2.7, Python 3.6, Python 3.8

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


More information about the docs mailing list