diff options
author | Raymond Hettinger <python@rcn.com> | 2013-03-23 15:21:52 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2013-03-23 15:21:52 (GMT) |
commit | 51612fd80372e385947032436ae4c657d9ca78a5 (patch) | |
tree | 73a10bdabed29aebaf4168e55e75067e78d9c08c | |
parent | cf936c7287b7a7cbb308895a4bf1222b5ba9392c (diff) | |
parent | 378170d5d95256ec17e20a5ce7dc1b6c99213874 (diff) | |
download | cpython-51612fd80372e385947032436ae4c657d9ca78a5.zip cpython-51612fd80372e385947032436ae4c657d9ca78a5.tar.gz cpython-51612fd80372e385947032436ae4c657d9ca78a5.tar.bz2 |
merge
-rw-r--r-- | Doc/library/stdtypes.rst | 2 | ||||
-rw-r--r-- | Objects/unicodeobject.c | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 7e5f04f..60df11d 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1627,6 +1627,8 @@ expression support in the :mod:`re` module). Return true if the string is a valid identifier according to the language definition, section :ref:`identifiers`. + Use :func:`keyword.iskeyword` to test for reserved identifiers such as + :keyword:`def` and :keyword:`class`. .. method:: str.islower() diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index cb93395..23e57f0 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -11369,7 +11369,10 @@ PyDoc_STRVAR(isidentifier__doc__, "S.isidentifier() -> bool\n\ \n\ Return True if S is a valid identifier according\n\ -to the language definition."); +to the language definition.\n\ +\n\ +Use keyword.iskeyword() to test for reserved identifiers\n\ +such as \"def\" and \"class\".\n"); static PyObject* unicode_isidentifier(PyObject *self) |