上一话题

token — 用于 Python 剖析树的常量

下一话题
就业培训     下载中心     Wiki     联络
登录   注册

Log
  1. 首页
  2. Python 3.12.4
  3. 索引
  4. 模块
  5. 下一
  6. 上一
  7. Python 标准库
  8. Python 语言服务
  9. keyword — 测试 Python 关键词

keyword — 测试 Python 关键词 ¶

源代码: Lib/keyword.py


This module allows a Python program to determine if a string is a keyword or soft keyword .

关键词。 iskeyword ( s ) ¶

返回 True if s is a Python keyword .

关键词。 kwlist ¶

Sequence containing all the keywords defined for the interpreter. If any keywords are defined to only be active when particular __future__ statements are in effect, these will be included as well.

关键词。 issoftkeyword ( s ) ¶

返回 True if s is a Python soft keyword .

Added in version 3.9.

关键词。 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.

Added in version 3.9.

上一话题

token — 用于 Python 剖析树的常量

下一话题

tokenize — 用于 Python 源代码的 Tokenizer

本页

  • 报告 Bug
  • 展示源

快速搜索

键入搜索术语或模块、类、函数名称。

  1. 首页
  2. Python 3.12.4
  3. 索引
  4. 模块
  5. 下一
  6. 上一
  7. Python 标准库
  8. Python 语言服务
  9. keyword — 测试 Python 关键词
  10. 版权所有  © 2014-2026 乐数软件    

    工业和信息化部: 粤ICP备14079481号-1