• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1:mod:`keyword` --- Testing for Python keywords
2==============================================
3
4.. module:: keyword
5   :synopsis: Test whether a string is a keyword in Python.
6
7**Source code:** :source:`Lib/keyword.py`
8
9--------------
10
11This module allows a Python program to determine if a string is a
12:ref:`keyword <keywords>`.
13
14
15.. function:: iskeyword(s)
16
17   Return ``True`` if *s* is a Python :ref:`keyword <keywords>`.
18
19
20.. data:: kwlist
21
22   Sequence containing all the :ref:`keywords <keywords>` defined for the
23   interpreter.  If any keywords are defined to only be active when particular
24   :mod:`__future__` statements are in effect, these will be included as well.
25