Python 参考手册
(中英文对照版)
作者:
Guido van Rossum
Fred L. Drake, Jr.
Python 开发组
Email: python-docs@python.org
版本 2.2
2001年12月21日
目录
前言(Front Matter)...........................................................................................................3
摘要(Abstract): .................................................................................................................4
1. 简介(Introduction) .......................................................................................................................4
1.1 记法(Notation)..........................................................................................................5
2. 词法分析(Lexical analysis) .........................................................................................................7
2.1 行结构(Line structure)..............................................................................................8
2.1.1 逻辑行(Logical lines) .............................................................................8
2.1.2 物理行(Physical lines) ............................................................................8
2.1.3 注释(Comments).....................................................................................8
2.1.4 显式行连接(Explicit line joining) ..........................................................9
2.1.5 隐式行连接(Implicit line joining) ..........................................................9
2.1.6 空行(Blank lines)..................................................................................10
2.1.7 缩进(Indentation)..................................................................................10
2.1.8 符号间的空白(Whitespace between tokens)........................................12
2.2 其它语言符号(Other tokens) .................................................................................13
2.3 标识符和关键字(Identifiers and keywords) ..........................................................13
2.3.1 关键字(Keywords)................................................................................13
2.3.2 保留的标识符类型(Reserved classes of identifiers)............................14
2.4 字面值(Literals)......................................................................................................14
2.4.1 串字面值(String literals).......................................................................15
2.4.2 串字面值的连接(String literal concatenation) .....................................18
2.4.3 数值型的字面值(Numeric literals) ......................................................18