Python 语言参考¶
版本: | 3.2 |
---|---|
日期: | October 09, 2017 |
该参考手册描述了 Python 的语法和 “核心语义”. 它很简洁, 但尽可能的准确和完整. 不必要的内建对象类型和内建函数的语义以及模块在 Python 标准库 中描述. 如果想要一份 Python 的非正式介绍, 参照 Python 入门教程. 对于 C 或 C++ 程序员, 还有两份额外的手册: 扩展和嵌入 Python 解释器 描述了如何写 Python 扩展 模块的高级情形, 而 Python/C API 参考手册 则详细描述了对 C/C++ 程序员可用的接口.
- 1. 简介
- 2. 词法分析
- 3. 数据模型
- 4. Execution model
- 5. Expressions
- 5.1. Arithmetic conversions
- 5.2. Atoms
- 5.3. Primaries
- 5.4. The power operator
- 5.5. Unary arithmetic and bitwise operations
- 5.6. Binary arithmetic operations
- 5.7. Shifting operations
- 5.8. Binary bitwise operations
- 5.9. Comparisons
- 5.10. Boolean operations
- 5.11. Conditional expressions
- 5.12. Lambdas
- 5.13. Expression lists
- 5.14. Evaluation order
- 5.15. Summary
- 6. Simple statements
- 6.1. Expression statements
- 6.2. Assignment statements
- 6.3. The
assert
statement - 6.4. The
pass
statement - 6.5. The
del
statement - 6.6. The
return
statement - 6.7. The
yield
statement - 6.8. The
raise
statement - 6.9. The
break
statement - 6.10. The
continue
statement - 6.11. The
import
statement - 6.12. The
global
statement - 6.13. The
nonlocal
statement
- 7. 复合语句
- 8. Top-level components
- 9. Full Grammar specification