The Python Language ReferencePython语言参考¶
This reference manual describes the syntax and “core semantics” of the language. 本参考手册描述了该语言的语法和“核心语义”。It is terse, but attempts to be exact and complete. 它简洁明了,但力求准确完整。The semantics of non-essential built-in object types and of the built-in functions and modules are described in The Python Standard Library. Python标准库中描述了非必要的内置对象类型以及内置函数和模块的语义。For an informal introduction to the language, see The Python Tutorial. 有关该语言的非正式介绍,请参阅Python教程。For C or C++ programmers, two additional manuals exist: Extending and Embedding the Python Interpreter describes the high-level picture of how to write a Python extension module, and the Python/C API Reference Manual describes the interfaces available to C/C++ programmers in detail.对于C或C++程序员,还有两本附加手册:扩展和嵌入Python解释器描述了如何编写Python扩展模块的高级图片,Python/C API参考手册详细描述了C/C++程序员可用的接口。
- 1.
Introduction介绍 - 2.
Lexical analysis词汇分析 - 3.
Data model数据模型 - 4.
Execution model执行模型 - 5.
The import system导入系统 - 6.
Expressions表达式- 6.1.
Arithmetic conversions算术转换 - 6.2.
Atoms原子 - 6.3.
Primaries初选 - 6.4.
Await expressionawait
表达式 - 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.
Assignment expressions赋值表达式 - 6.13.
Conditional expressions条件表达式 - 6.14. Lambdas
- 6.15.
Expression lists表达式列表 - 6.16.
Evaluation order计算顺序 - 6.17.
Operator precedence运算符优先级
- 6.1.
- 7.
Simple statements简单语句- 7.1.
Expression statements表达式语句 - 7.2.
Assignment statements赋值语句 - 7.3.
Theassert
statementassert
语句 - 7.4.
Thepass
statementpass
语句 - 7.5.
Thedel
statementdel
语句 - 7.6.
Thereturn
statementreturn
语句 - 7.7.
Theyield
statementyield
语句 - 7.8.
Theraise
statementraise
语句 - 7.9.
Thebreak
statementbreak
语句 - 7.10.
Thecontinue
statementcontinue
语句 - 7.11.
Theimport
statementimport
语句 - 7.12.
Theglobal
statementglobal
语句 - 7.13.
Thenonlocal
statementnonlocal
语句
- 7.1.
- 8.
Compound statements复合语句 - 9.
Top-level components顶级组件 - 10.
Full Grammar specification完整语法规范