# Dive Into Python

Python from novice to pro

Find:

## Appendix A. Further reading

Chapter 1. Installing Python

Chapter 2. Your First Python Program

- 2.3. Documenting Functions

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

- 2.4.2. What's an Object?

  - Python Reference Manual explains exactly what it means to say that everything in Python is an object, because some people are pedantic and like to discuss this sort of thing at great length.
  - eff-bot summarizes Python objects.

- 2.5. Indenting Code

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

- 2.6. Testing Modules

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

Chapter 3. Native Datatypes

- 3.1.3. Deleting Items From Dictionaries

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

- 3.2.5. Using List Operators

  - 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 a lot of example code using lists.
  - Python Library Reference summarizes all the list methods.

- 3.3. Introducing Tuples

  - 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.

- 3.4.2. Assigning Multiple Values at Once

  - Python Reference Manual shows examples of when you can skip the line continuation character and when you need to use it.
  - How to Think Like a Computer Scientist shows how to use multi-variable assignment to swap the values of two variables.

- 3.5. 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.

- 3.6. Mapping Lists

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

- 3.7. Joining Lists and Splitting Strings

  - Python Knowledge Base answers common questions about strings and has a lot of example code using strings.
  - Python Library Reference summarizes all the string methods.
  - Python Library Reference documents the `string` module.
  - The Whole Python FAQ explains why `join` is a string method instead of a list method.

Chapter 4. The Power Of Introspection

- 4.2. Using 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.

- 4.3.3. Built-In Functions

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

- 4.5. Filtering Lists

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

- 4.6.1. Using the and-or Trick

  - Python Cookbook discusses alternatives to the `and-or` trick.

- 4.7.1. Real-World 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 how this will change in future versions of Python.)
  - The Whole Python FAQ has examples of obfuscated one-liners using `lambda`.

Chapter 5. Objects and Object-Orientation

- 5.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 *`.

- 5.3.2. Knowing When to Use self and __init__

  - 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.

- 5.4.1. Garbage Collection

  - 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.

- 5.5. Exploring UserDict: A Wrapper Class

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

- 5.7. Advanced Special Class Methods

  - Python Reference Manual documents all the special class methods.

- 5.9. Private Functions

  - Python Tutorial discusses the inner workings of private variables.

Chapter 6. Exceptions and File Handling

- 6.1.1. Using Exceptions For Other Purposes

  - Python Tutorial discusses defining and raising your own exceptions, and handling multiple exceptions at once.
  - Python Library Reference summarizes all the built-in exceptions.
  - Python Library Reference documents the getpass module.
  - 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.

- 6.2.4. Writing to Files

  - 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.

- 6.4. Using sys.modules

  - Python Tutorial discusses exactly when and how default arguments are evaluated.
  - Python Library Reference documents the `sys` module.

- 6.5. Working with Directories

  - Python Knowledge Base answers questions about the `os` module.
  - Python Library Reference documents the `os` module and the `os.path` module.

Chapter 7. Regular Expressions

- 7.6. Case study: Parsing Phone Numbers

  - Regular Expression HOWTO teaches about regular expressions and how to use them in Python.
  - Python Library Reference summarizes the `re` module.

Chapter 8. HTML Processing

- 8.4. Introducing BaseHTMLProcessor.py

  - W3C discusses character and entity references.
  - Python Library Reference confirms your suspicions that the `htmlentitydefs` module is exactly what it sounds like.

- 8.9. Putting it all together

  - You thought I was kidding about the server-side scripting idea. So did I, until I found this web-based dialectizer. Unfortunately, source code does not appear to be available.

Chapter 9. XML Processing

- 9.4. Unicode

  - Unicode.org is the home page of the unicode standard, including a brief technical introduction.
  - Unicode Tutorial has some more examples of how to use Python's unicode functions, including how to force Python to coerce unicode into ASCII even when it doesn't really want to.
  - PEP 263 goes into more detail about how and when to define a character encoding in your `.py` files.

Chapter 10. Scripts and Streams

Chapter 11. HTTP Web Services

- 11.1. Diving in

  - Paul Prescod believes that pure HTTP web services are the future of the Internet.

Chapter 12. SOAP Web Services

- 12.1. Diving In

  - http://www.xmethods.net/ is a repository of public access SOAP web services.
  - The SOAP specification is surprisingly readable, if you like that sort of thing.

- 12.8. Troubleshooting SOAP Web Services

  - New developments for SOAPpy steps through trying to connect to another SOAP service that doesn't quite work as advertised.

Chapter 13. Unit Testing

- 13.1. Introduction to Roman numerals

  - This site has more on Roman numerals, including a fascinating history of how Romans and other civilizations really used them (short answer: haphazardly and inconsistently).

- 13.3. Introducing romantest.py

  - The PyUnit home page has an in-depth discussion of using the `unittest` framework, including advanced features not covered in this chapter.
  - The PyUnit FAQ explains why test cases are stored separately from the code they test.
  - Python Library Reference summarizes the `unittest` module.
  - ExtremeProgramming.org discusses why you should write unit tests.
  - The Portland Pattern Repository has an ongoing discussion of unit tests, including a standard definition, why you should code unit tests first, and several in-depth case studies.

Chapter 14. Test-First Programming

Chapter 15. Refactoring

- 15.5. Summary

  - XProgramming.com has links to download unit testing frameworks for many different languages.

Chapter 16. Functional Programming

Chapter 17. Dynamic functions

- 17.7. plural.py, stage 6

  - PEP 255 defines generators.
  - Python Cookbook has many more examples of generators.

Chapter 18. Performance Tuning

- 18.1. Diving in

  - Soundexing and Genealogy gives a chronology of the evolution of the Soundex and its regional variations.