mirror of
https://github.com/python/cpython.git
synced 2024-12-17 13:54:14 +08:00
138ccbb022
* "Return true/false" is replaced with "Return ``True``/``False``" if the function actually returns a bool. * Fixed formatting of some True and False literals (now in monospace). * Replaced "True/False" with "true/false" if it can be not only bool. * Replaced some 1/0 with True/False if it corresponds the code. * "Returns <bool>" is replaced with "Return <bool>".
24 lines
621 B
ReStructuredText
24 lines
621 B
ReStructuredText
:mod:`keyword` --- Testing for Python keywords
|
|
==============================================
|
|
|
|
.. module:: keyword
|
|
:synopsis: Test whether a string is a keyword in Python.
|
|
|
|
**Source code:** :source:`Lib/keyword.py`
|
|
|
|
--------------
|
|
|
|
This module allows a Python program to determine if a string is a keyword.
|
|
|
|
|
|
.. function:: iskeyword(s)
|
|
|
|
Return ``True`` if *s* is a Python keyword.
|
|
|
|
|
|
.. data:: kwlist
|
|
|
|
Sequence containing all the keywords defined for the interpreter. If any
|
|
keywords are defined to only be active when particular :mod:`__future__`
|
|
statements are in effect, these will be included as well.
|