You are here: Home ‣ Dive Into Python 3 ‣
Table of contents
- Installing Python
- Python on Windows
- Python on Mac OS X
- Python on Ubuntu Linux
- Python from source
- The interactive shell
- Your first Python program
- Diving in
- Declaring functions
- Writing readable code
- Docstrings
- Function annotations
- Style conventions
- Everything is an object
- The
import search path
- What's an object?
- Indenting code
- Running scripts
- Further reading
- Native Python datatypes
- Diving in
- Booleans
- Numbers
- Lists
- Dictionaries
None
- Further reading
- Strings
- There ain't no such thing as plain text
- A brief history of character encoding
- What's a character?
- How strings are stored in memory
- Converting between different character encodings
- Formatting strings
- What's my string?
- Lists and strings
- Historical note on the string module
- Byte streams
- Summary
- Regular expressions
- Diving in
- Case study: street addresses
- Case study: Roman numerals
- Checking for thousands
- Checking for hundreds
- Using the
{n,m} Syntax
- Checking for tens and ones
- Verbose regular expressions
- Case study: parsing phone numbers
- Summary
- The power of introspection
- Diving in
- Using optional and named arguments
- Keyword-only arguments
- Using type, str, dir, and other built-in functions
- The type function
- The str function
- Built-in functions
- Getting object references with getattr
- getattr with modules
- getattr as a dispatcher
- Filtering lists
- Using lambda functions
- Putting it all together
- Summary
- Objects and object-orientation
- ...major changes afoot...
- ...stuff about decorators...
- ...stuff about importing modules...
- ...mention why from module import * is only allowed at module level
- Unit testing
- (Not) diving in
- A single question
- “Halt and catch fire”
- More halting, more fire
- ...
- Test-first programming
- ...
- Refactoring your code
- Handling bugs
- Handling changing requirements
- The art of refactoring
- Postscript
- Summary
- Files
- File objects
- Reading files
- Close your files... or don't
- Handling errors (exceptions)
- Writing to files
- HTML processing
- Diving in
- html5lib
- Installing html5lib
- Using html5lib
- Extracting data from HTML documents
- Building HTML documents
- Putting it all together
- Summary
- XML Processing
- ...major changes afoot...
- HTTP web services
- Diving in
- How not to fetch data over HTTP
- Features of HTTP
- User-Agent
- Redirects
- Last-Modified/If-Modified-Since
- ETag-If-None-Match
- Compression
- Differences from Python 2
- httplib2 (note: needs port)
- Installing httplib2
- Why httplib2 is better than http.client
- Debugging HTTP web services
- Setting the User-Agent
- Handling Last-Modified and ETag
- Handling redirects
- Handling compressed data
- Putting it all together
- Summary
- Dynamic functions
- Diving in
- plural.py, stage 1
- plural.py, stage 2
- plural.py, stage 3
- plural.py, stage 4
- plural.py, stage 5
- plural.py, stage 6
- Summary
- Metaclasses
- ...once I figure out WTF metaclasses are...
- Performance tuning
- Diving in
- Using the timeit module
- Optimizing regular expressions
- Optimizing dictionary lookups
- Optimizing list operations
- Optimizing string manipulation
- Summary
- Packaging Python libraries
- A brief history of packaging (and why it's harder than you think)
- setuptools
- distutils
- Eggs
- pip
- Platform-specific packaging
- Packaging by Linux distributions
- Py2exe
- Creating graphics with the Python Imaging Library
- ...will likely get ported in time...
- Where to go from here (tentative because most of these have not been ported to Python 3 yet)
- WSGI
- Django
- Pylons
- TurboGears
- AppEngine
- IronPython
- Jython
- PyPy
- Stackless Python
- Case study: porting
chardet to Python 3
- Introducing
chardet: a mini-FAQ
- What is character encoding auto-detection?
- Isn't that impossible?
- Who wrote this detection algorithm?
- Yippie! Screw the standards, I'll just auto-detect everything!
- Why bother with auto-detection if it's slow, inaccurate, and non-standard?
- Diving in
UTF-n with a BOM
- Escaped encodings
- Multi-byte encodings
- Single-byte encodings
windows-1252
- Running
2to3
- Fixing what
2to3 can't
False is invalid syntax
- No module named
constants
- Name 'file' is not defined
- Can't use a string pattern on a bytes-like object
- Can't convert '
bytes' object to str implicitly
Orphans (not sure where these belong yet):
- Tuples
- Iterators
- Generators
- List comprehensions
- Set comprehensions
- Dictionary comprehensions
- Views (several dictionary methods return them, they're dynamic, update when the dictionary changes, etc.)
© 2001–4, 2009 ℳark Pilgrim • open standards • open content • open source