python语言的关键字true_keyword — 检验Python关键字

### 导航

- [索引](../genindex.xhtml "总目录")

- [模块](../py-modindex.xhtml "Python 模块索引") |

- [下一页](tokenize.xhtml "tokenize --- Tokenizer for Python source") |

- [上一页](token.xhtml "token --- 与Python解析树一起使用的常量") |

- ![](https://box.kancloud.cn/a721fc7ec672275e257bbbfde49a4d4e_16x16.png)

- [Python](https://www.python.org/) »

- zh\_CN 3.7.3 [文档](../index.xhtml) »

- [Python 标准库](index.xhtml) »

- [Python 语言服务](language.xhtml) »

- $('.inline-search').show(0); |

# [`keyword`](#module-keyword "keyword: Test whether a string is a keyword in Python.") --- 检验Python关键字

**源码:** [Lib/keyword.py](https://github.com/python/cpython/tree/3.7/Lib/keyword.py) \[https://github.com/python/cpython/tree/3.7/Lib/keyword.py\]

- - - - - -

此模块允许 Python 程序确定字符串是否为关键字。

`keyword.``iskeyword`(*s*)如果 *s* 是Python关键字,则返回true。

`keyword.``kwlist`序列包含为解释器定义的所有关键字。 如果任何被定义的关键字为仅在 [`__future__`](__future__.xhtml#module-__future__ "__future__: Future statement definitions") 语句生效是特定时间处于活动状态,则也将包含这些关键字。

### 导航

- [索引](../genindex.xhtml "总目录")

- [模块](../py-modindex.xhtml "Python 模块索引") |

- [下一页](tokenize.xhtml "tokenize --- Tokenizer for Python source") |

- [上一页](token.xhtml "token --- 与Python解析树一起使用的常量") |

- ![](https://box.kancloud.cn/a721fc7ec672275e257bbbfde49a4d4e_16x16.png)

- [Python](https://www.python.org/) »

- zh\_CN 3.7.3 [文档](../index.xhtml) »

- [Python 标准库](index.xhtml) »

- [Python 语言服务](language.xhtml) »

- $('.inline-search').show(0); |

© [版权所有](../copyright.xhtml) 2001-2019, Python Software Foundation.

Python 软件基金会是一个非盈利组织。 [请捐助。](https://www.python.org/psf/donations/)

最后更新于 5月 21, 2019. [发现了问题](../bugs.xhtml)?

使用[Sphinx](http://sphinx.pocoo.org/)1.8.4 创建。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值