• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1"""Keywords (from "Grammar/python.gram")
2
3This file is automatically generated; please don't muck it up!
4
5To update the symbols in this file, 'cd' to the top directory of
6the python source tree and run:
7
8    PYTHONPATH=Tools/peg_generator python3 -m pegen.keywordgen \
9        Grammar/python.gram \
10        Grammar/Tokens \
11        Lib/keyword.py
12
13Alternatively, you can run 'make regen-keyword'.
14"""
15
16__all__ = ["iskeyword", "issoftkeyword", "kwlist", "softkwlist"]
17
18kwlist = [
19    'False',
20    'None',
21    'True',
22    'and',
23    'as',
24    'assert',
25    'async',
26    'await',
27    'break',
28    'class',
29    'continue',
30    'def',
31    'del',
32    'elif',
33    'else',
34    'except',
35    'finally',
36    'for',
37    'from',
38    'global',
39    'if',
40    'import',
41    'in',
42    'is',
43    'lambda',
44    'nonlocal',
45    'not',
46    'or',
47    'pass',
48    'raise',
49    'return',
50    'try',
51    'while',
52    'with',
53    'yield'
54]
55
56softkwlist = [
57    '_',
58    'case',
59    'match'
60]
61
62iskeyword = frozenset(kwlist).__contains__
63issoftkeyword = frozenset(softkwlist).__contains__
64