keyword
--- 检验Python关键字¶
源码: Lib/keyword.py
This module allows a Python program to determine if a string is a keyword or soft keyword.
-
keyword.
kwlist
¶ 包含解释器定义的所有 关键字 的序列。 如果所定义的任何关键字仅在特定
__future__
语句生效时被激活,它们也将被包含在内。
-
keyword.
issoftkeyword
(s)¶ Return
True
if s is a Python soft keyword.3.9 新版功能.
-
keyword.
softkwlist
¶ Sequence containing all the soft keywords defined for the interpreter. If any soft keywords are defined to only be active when particular
__future__
statements are in effect, these will be included as well.3.9 新版功能.