bpo-33014: Clarify str.isidentifier docstring (GH-6088)
* bpo-33014: Clarify str.isidentifier docstring
* bpo-33014: Add code example in isidentifier documentation
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index a797f83..16dd3d1 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -12100,13 +12100,13 @@
Return True if the string is a valid Python identifier, False otherwise.
-Use keyword.iskeyword() to test for reserved identifiers such as "def" and
-"class".
+Call keyword.iskeyword(s) to test whether string s is a reserved identifier,
+such as "def" or "class
[clinic start generated code]*/
static PyObject *
unicode_isidentifier_impl(PyObject *self)
-/*[clinic end generated code: output=fe585a9666572905 input=916b0a3c9f57e919]*/
+/*[clinic end generated code: output=fe585a9666572905 input=2fb643aafbcf0e1c]*/
{
return PyBool_FromLong(PyUnicode_IsIdentifier(self));
}