Running Python. Variables and Arithmetic Expressions. Conditionals. File Input and Output. Strings. Lists and Tuples. Loops. Dictionaries. Functions. Classes. Exceptions. Modules.
1. A Tutorial Introduction.
2. Lexical Conventions and Syntax.
Line Structure and Indentation. Identifiers and Reserved Words. Literals. Operators, Delimiters, and Special Symbols. Documentation Strings.
3. Types and Objects.
Terminology. Object Identity and Type. Reference Counting and Garbage Collection. References and Copies. Special Methods Performance and Memory Considerations.
4. Operators and Expressions.
Operations on Numbers. Operations on Sequences. Operations on Dictionaries. Augmented Assignment. The Attribute (.) Operator. Type Conversion. Unicode Strings. Boolean Expressions and Truth Values. Object Equality and Identity. Order of Evaluation. Conditionals. Loops.
5. Control Flow.
Exceptions. Defining New Exceptions. Assertions and _ _debug_ _. Functions.
6. Functions and Functional Programming.
Parameter Passing and Return Values. Scoping Rules. Recursion. The apply() Function. The lambda Operator. map(), zip(), reduce(), and filter(). List Comprehensions. eval(), exec, execfile(), and compile(). The class statement.
7. Classes and Object-Oriented Programming.
Class Instances. Reference Counting and Instance Destruction. Inheritance. Polymorphism. Information Hiding. Operator Overloading. Classes, Types, and Membership Tests.
8. Modules and Packages.
Modules. The Module Search Path. Module Loading and Compilation. Module Reloading. Packages.
9. Input and Output.
Reading Options and Environment Variables. Files. Standard Input, Output, and Error. The print Statement. Persistence. Unicode I/O. Interpreter Options and Environment.
10. Execution Environment.
Interactive Sessions. Launching Python Applications. Site Configuration Files. Enabling Future Features. Program Termination.
A. The Python Library.
Built-in Functions and Exceptions. Mathematics. String Handling. Data Management and Object Persistence. Operating System Services. Threads. Network Programming. Internet Data Handling and Encoding. Restricted Execution. Miscellaneous Modules. The Python Debugger. The Python Profiler. Undocumented Modules.
B. Extending and Embedding Python.
Enabling Optional Modules. Compilation of Extensions. Converting Data from Python to C. Converting Data from C to Python. Error Handling. Reference Counting. Calling Python from C. Abstract Object Layer. Low-Level Functions on Built-in Types. Defining New Types. Special Methods for Types. Threads. Embedding. Extension Building Tools.
C. Summary of Changes.
Python 1.6. Python 2.0. Python 2.1.