The Python Language Reference¶
This reference manual describes the syntax and “core semantics” of the language. It is terse, but attempts to be exact and complete. Python标准库中描述了非必需的内置对象类型以及内置函数和模块的语义。 有关该语言的非正式介绍,请参见The Python Tutorial。 对于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 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. The
del
statement - 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. Full Grammar specification