Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 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 | |
| 8 | This module allows a Python program to determine if a string is a keyword. |
| 9 | |
| 10 | |
| 11 | .. function:: iskeyword(s) |
| 12 | |
| 13 | Return true if *s* is a Python keyword. |
| 14 | |
| 15 | |
| 16 | .. data:: kwlist |
| 17 | |
| 18 | Sequence containing all the keywords defined for the interpreter. If any |
| 19 | keywords are defined to only be active when particular :mod:`__future__` |
| 20 | statements are in effect, these will be included as well. |
| 21 | |
Éric Araujo | 6e6cb8e | 2010-11-16 19:13:50 +0000 | [diff] [blame] | 22 | |
| 23 | .. seealso:: |
| 24 | |
| 25 | Latest version of the :source:`keyword module Python source code |
| 26 | <Lib/keyword.py>` |