Python 语言参考¶
本参考手册描述了 Python 的语法和“核心语义”。本参考是简洁的,但试图做到准确和完整。 非必要的内建对象类型和内建函数、模块的语义描述在 Python 标准库 中。有关该语言的非正式介绍,请参阅 Python教程 。对 C 或 C++ 程序员,还有两个额外的手册: Extending and Embedding the Python Interpreter 概述了如何编写一个 Python 扩展模块,Python/C API 参考手册 详细介绍了 C/C++ 中可用的接口。
- 1. 概述
- 2. 词法分析
- 3. 数据类型
- 4. Execution model
- 5. The import system
- 6. 表达式
- 6.1. Arithmetic conversions
- 6.2. Atoms
- 6.3. Primaries
- 6.4. Await expression
- 6.5. The power operator
- 6.6. Unary arithmetic and bitwise operations
- 6.7. Binary arithmetic operations
- 6.8. Shifting operations
- 6.9. Binary bitwise operations
- 6.10. Comparisons
- 6.11. Boolean operations
- 6.12. Conditional expressions
- 6.13. Lambdas
- 6.14. Expression lists
- 6.15. Evaluation order
- 6.16. Operator precedence
- 7. Simple statements
- 7.1. Expression statements
- 7.2. Assignment statements
- 7.3. The
assert
statement - 7.4. The
pass
statement - 7.5.
del
语句 - 7.6. The
return
statement - 7.7. The
yield
statement - 7.8. The
raise
statement - 7.9. The
break
statement - 7.10. The
continue
statement - 7.11. The
import
statement - 7.12. The
global
statement - 7.13. The
nonlocal
statement
- 8. Compound statements
- 9. Top-level components
- 10. 完整的语法规范