<< >>

diveintopython.org |

Python for experienced programmers

## Appendix A. Further reading

Chapter 1. Getting To Know Python

- 1.3. Documenting functions

  - Python Style Guide discusses how to write a good `doc string`.
  - Python Tutorial discusses conventions for spacing in `doc string`s.

- 1.4. Everything is an object

  - Python Reference Manual explains exactly what it means to say that everything in Python is an object.
  - eff-bot summarizes Python objects.

- 1.5. Indenting code

  - Python Reference Manual discusses cross-platform indentation issues and shows various indentation errors.
  - Python Style Guide discusses good indentation style.

- 1.6. Testing modules

  - Python Reference Manual discusses the low-level details of importing modules.

- 1.7. Dictionaries 101

  - How to Think Like a Computer Scientist teaches about dictionaries and shows how to use dictionaries to model sparse matrices.
  - Python Knowledge Base has lots of example code using dictionaries.
  - Python Library Reference summarizes all the dictionary methods.

- 1.8. Lists 101

  - How to Think Like a Computer Scientist teaches about lists and makes an important point about passing lists as function arguments.
  - Python Tutorial shows how to use lists as stacks and queues.
  - Python Knowledge Base answers common questions about lists and has lots of example code using lists.
  - Python Library Reference summarizes all the list methods.

- 1.9. Tuples 101

  - How to Think Like a Computer Scientist teaches about tuples and shows how to concatenate tuples.
  - Python Knowledge Base shows how to sort a tuple.
  - Python Tutorial shows how to define a tuple with one element.

- 1.10. Defining variables

  - Python Reference Manual shows examples of when you can skip the line continuation character and when you have to use it.

- 1.11. Formatting strings

  - Python Library Reference summarizes all the string formatting format characters.
  - Effective AWK Programming discusses all the format characters and advanced string formatting techniques like specifying width, precision, and zero-padding.

- 1.12. Mapping lists

  - Python Tutorial discusses another way to map lists using the built-in `map` function.
  - Python Tutorial shows how to do nested list mapping.

- 1.13. Joining lists and splitting strings

  - Python Knowledge Base answers common questions about strings and has lots of example code using strings.
  - Python Library Reference summarizes all the string methods.
  - Python Library Reference documents the `string` module.

Chapter 2. The Power Of Introspection

- 2.2. Importing modules using from module import

  - eff-bot has more to say on `import module` vs. `from module import`.
  - Python Tutorial discusses advanced import techniques, including `from module import *`.

- 2.3. Optional and named arguments

  - Python Tutorial discusses exactly when and how default arguments are evaluated, which matters when the default value is a list or an expression with side effects.

- 2.4. type, str, dir, and other built-in functions

  - Python Library Reference documents all the built-in functions and all the built-in exceptions.

- 2.6. Filtering lists

  - Python Tutorial discusses another way to filter lists using the built-in `filter` function.

- 2.8. Using lambda functions

  - Python Knowledge Base discusses using `lambda` to call functions indirectly.
  - Python Tutorial shows how to access outside variables from inside a `lambda` function. (PEP 227 explains why this technique is unnecessary in Python 2.1, which supports nested scopes.)
  - The Whole Python FAQ has examples of obfuscated one-liners using `lambda`.

Chapter 3. An Object-Oriented Framework

- 3.2. Defining classes

  - Learning to Program has a gentler introduction to classes.
  - How to Think Like a Computer Scientist shows how to use classes to model compound datatypes.
  - Python Tutorial has an in-depth look at classes, namespaces, and inheritance.
  - Python Knowledge Base answers common questions about classes.

- 3.3. Instantiating classes

  - Python Library Reference summarizes built-in attributes like `__class__`.
  - Python Library Reference documents the `gc` module, which gives you low-level control over Python's garbage collection.

- 3.4. UserDict: a wrapper class

  - Python Library Reference documents the `UserDict` module and the `copy` module.

- 3.6. Advanced special class methods

  - Python Reference Manual documents all the special class methods.

- 3.8. Private functions

  - Python Tutorial discusses the inner workings of private variables.

- 3.9. Handling exceptions

  - Python Tutorial discusses exceptions, including raising your own exceptions and handling multiple exceptions at once.
  - Python Library Reference summarizes all the built-in exceptions.
  - Python Library Reference documents the `traceback` module, which provides low-level access to exception attributes after an exception is raised.
  - Python Reference Manual discusses the inner workings of the `try...except` block.

- 3.10. File objects

  - Python Tutorial discusses reading and writing files, including how to read a file one line at a time into a list.
  - eff-bot discusses efficiency and performance of various ways of reading a file.
  - Python Knowledge Base answers common questions about files.
  - Python Library Reference summarizes all the file object methods.

- 3.12. Assigning multiple values at once

  - How to Think Like a Computer Scientist shows how to use multiple assignment to swap the values of two variables.
  - Python Knowledge Base answers questions about the `os` module.

« More on modules | A 5-minute review »