[docs] [issue33014] Clarify str.isidentifier docstring, fix keyword.iskeyword docstring

Terry J. Reedy report at bugs.python.org
Sat Mar 10 12:44:28 EST 2018


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

Debating historical design decisions that effectively cannot be changed is off topic for the tracker (but fair game on python-list).  However, I will explain this much.  The s.isxyz questions are answered by examining the characters and codepoints in s.  Answering iskeyword(s) requires reference to the collection of keywords, kwlist, which must be exposed to users, and which may change in any new version.  We usually attach constant data attributes to modules (other than builtins), and never (that I can think of) to built-in classes.  "def iskeyword(s): return s in kwlist:" belongs in the module with kwlist.

----------
nosy:  -willingc
title: Clarify doc string for str.isidentifier() -> Clarify str.isidentifier docstring, fix keyword.iskeyword docstring

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


More information about the docs mailing list