Python Reference Language

r

Based on: Python Reference Manual Guido van RossumPython Software FoundationRelease 2.5.2

a

1. Introduction

a

* 1.1 Alternate Implementations

* 1.2 Notation

Go Geometry

a

2. Lexical analysis

a

* 2.1 Line structure

o 2.1.1 Logical lines

o 2.1.2 Physical lines

o 2.1.3 Comments

o 2.1.4 Encoding declarations

o 2.1.5 Explicit line joining

o 2.1.6 Implicit line joining

o 2.1.7 Blank lines

o 2.1.8 Indentation

o 2.1.9 Whitespace between tokens

* 2.2 Other tokens

* 2.3 Identifiers and keywords

o 2.3.1 Keywords

o 2.3.2 Reserved classes of identifiers

* 2.4 Literals

o 2.4.1 String literals

o 2.4.2 String literal concatenation

o 2.4.3 Numeric literals

o 2.4.4 Integer and long integer literals

o 2.4.5 Floating point literals

o 2.4.6 Imaginary literals

* 2.5 Operators

* 2.6 Delimiters

3. Data model

a

* 3.1 Objects, values and types

* 3.2 The standard type hierarchy

* 3.3 New-style and classic classes

* 3.4 Special method names

o 3.4.1 Basic customization

o 3.4.2 Customizing attribute access

o 3.4.3 Customizing class creation

o 3.4.4 Emulating callable objects

o 3.4.5 Emulating container types

o 3.4.6 Additional methods for emulation of sequence types

o 3.4.7 Emulating numeric types

o 3.4.8 Coercion rules

o 3.4.9 With Statement Context Managers

4. Execution model

a

* 4.1 Naming and binding

o 4.1.1 Interaction with dynamic features

* 4.2 Exceptions

5. Expressions

a

* 5.1 Arithmetic conversions

* 5.2 Atoms

o 5.2.1 Identifiers (Names)

o 5.2.2 Literals

o 5.2.3 Parenthesized forms

o 5.2.4 List displays

o 5.2.5 Generator expressions

o 5.2.6 Dictionary displays

o 5.2.7 String conversions

o 5.2.8 Yield expressions

* 5.3 Primaries

o 5.3.1 Attribute references

o 5.3.2 Subscriptions

o 5.3.3 Slicings

o 5.3.4 Calls

* 5.4 The power operator

* 5.5 Unary arithmetic operations

* 5.6 Binary arithmetic operations

* 5.7 Shifting operations

* 5.8 Binary bit-wise operations

* 5.9 Comparisons

* 5.10 Boolean operations

* 5.11 Lambdas

* 5.12 Expression lists

* 5.13 Evaluation order

* 5.14 Summary

6. Simple statements

a

* 6.1 Expression statements

* 6.2 Assert statements

* 6.3 Assignment statements

o 6.3.1 Augmented assignment statements

* 6.4 The pass statement

* 6.5 The del statement

* 6.6 The print statement

* 6.7 The return statement

* 6.8 The yield statement

* 6.9 The raise statement

* 6.10 The break statement

* 6.11 The continue statement

* 6.12 The import statement

o 6.12.1 Future statements

* 6.13 The global statement

* 6.14 The exec statement

7. Compound statements

a

* 7.1 The if statement

* 7.2 The while statement

* 7.3 The for statement

* 7.4 The try statement

* 7.5 The with statement

* 7.6 Function definitions

* 7.7 Class definitions

8. Top-level components

a

* 8.1 Complete Python programs

* 8.2 File input

* 8.3 Interactive input

* 8.4 Expression input

A. History and License

a

Index

a