keyword.py 1.0 KB

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