The Book That Arrived on a CD-ROM
When Python 3: Das umfassende Handbuch landed in 2012, it came with a CD-ROM. That detail alone dates the object more precisely than any copyright page. The disc held Python installers, example code, and the authors’ earlier Python 2.5 handbook rendered as HTML – a physical bridge between the version developers were leaving and the one they were supposed to adopt. Johannes Ernesti and Peter Kaiser, writing for Galileo Press in Bonn, produced a 960-page German-language reference that aimed to sit between beginner tutorials and the official documentation. They explicitly skipped formal computer-science theory in favor of practical usage, targeting three audiences: beginners with prior programming experience, experienced programmers switching languages, and seasoned Python developers who needed a desk reference.
Today, the book reads like an archaeological layer. It captures Python 3.2 and 3.3 – the versions current when the manuscript went to press – before asyncio, pathlib, type hints, match statements, dataclasses, modern packaging, or pytest existed. Its value isn’t as a learning resource but as a structural map of the “batteries-included” standard library as it stood before the async/await revolution and the packaging ecosystem overhaul.
A Pedagogy Built on the Object Model
The authors make a deliberate choice early: Chapter 5 and 6 introduce Python’s runtime object model before control flow or functions. Every variable is an untyped reference to an object carrying identity (id()), type (type()), and value. Assignment binds names; rebinding creates new references. Mutability becomes the great divider – list, dict, set versus int, str, tuple, frozenset – and the book demonstrates aliasing side effects with concrete examples like a = [1,2]; b = a; a += [3,4] mutating both references.
This model isn’t academic preamble. It underpins everything that follows: parameter passing (“call by reference”), the default-argument trap where mutable defaults persist across calls, and the scoping rules for nonlocal and global. By making the object model the pedagogical backbone, the book gives readers a mental framework that explains why Python behaves as it does, not just how to write syntax.
Magic Methods as Extension Protocols
Chapters 11 and 12 catalog dunder methods as the extension mechanism for custom types. The treatment is systematic: numeric protocols (__add__, __radd__, __iadd__), container protocols (__len__, __getitem__, __setitem__, __iter__, __contains__), context managers (__enter__, __exit__), and attribute hooks (__getattr__, __setattr__, __slots__). A SortierteListe example – a list subclass overriding every mutating method to call self.sort() – illustrates both the power and fragility of protocol adherence. Slice assignment, it turns out, bypasses __setitem__, a gotcha that teaches protocol completeness the hard way.
The book’s OOP examples use explicit Base.__init__(self) calls rather than super(), a reminder that cooperative inheritance patterns have evolved. The GirokontoMitTagesumsatz bank-account hierarchy demonstrates inheritance, daily-limit validation, and composition over inheritance for customer data – practical domain modeling that still translates.
The Standard Library Organized by Engineering Task
Part III (Chapters 13-20) organizes the standard library by engineering domain rather than module alphabet. This task-oriented framing mirrors how practitioners actually search for solutions:
- Mathematics: math, cmath, decimal, random, itertools
- Text processing: re, gettext, hashlib
- Temporal data: time, datetime, timedelta
- OS interaction: os, sys, shutil, tempfile, argparse, atexit
- Concurrency: _thread, threading with Lock, Queue, Event, Barrier, Timer
- Persistence: gzip, XML DOM/SAX/ElementTree, sqlite3, pickle, csv
- Networking: raw sockets, select, socketserver, HTTP/FTP/SMTP/POP3/IMAP/email/XML-RPC/Telnet
- Diagnostics: pdb, inspect, logging, doctest, unittest
Each chapter demonstrates minimal working snippets. A CLI calculator uses argparse with a dispatch table and nargs=”+” for variadic operands. Regex pipelines extract HTML links with non-greedy href capture and parse business cards in two stages: colon-split dict followed by field validation via re.match. An XML-RPC multicall example batches client calls via MultiCall; the server opts in via register_multicall_functions. A SQLite warehouse shows normalized schema, parameterized queries with ? placeholders, executemany for bulk insert, and Row factory for column-name access.
Migration as a First-Class Chapter
Chapter 27 dedicates roughly 30 pages to Python 2→3 migration – the final chapter, not an appendix. It documents the deliberate backward-compatibility break: print function, input()/raw_input() unification, iterator views (range, map, filter, zip), Unicode-first str/bytes separation, unified int/long, true division (/), exception syntax (as), and standard-library reorganization (ConfigParser→configparser, Queue→queue, new packages http, urllib, html, dbm, xmlrpc, tkinter).
The 2to3 tool gets a 14-line demonstration showing conversions: xrange→range, except E, v→except E as v, print statement→function. The authors note a limitation: 2to3 cannot auto-determine whether a print statement needs parentheses if from __future__ import print_function was already used – a subtle edge case that reveals the tool’s heuristic nature.
C Interoperability as a Three-Layer Stack
Chapter 25 presents three distinct C-interop strategies, each with different trade-offs:
- ctypes: Load dynamic libraries and call functions without writing C. The example loads MSVCRT or libc.so.6 and calls printf; a custom DLL demonstrates in-place array sorting. No compilation needed, but segfault risk and call overhead remain.
- CPython API extensions: Write C modules with PyMethodDef, PyModuleDef, PyInit_*. Full API access for performance-critical hot paths, but reference-count complexity (owned, borrowed, returned references) demands discipline.
- Embedding: Initialize the interpreter via Py_Initialize, run code via PyRun_SimpleString/PyRun_SimpleFile, finalize via Py_Finalize. The example shows bidirectional calls: C→Python via PyObject_CallObject, Python→C via module registration. PyImport_AppendInittab must precede Py_Initialize().
This taxonomy clarifies decisions that still face developers today: use ctypes for existing DLLs, extensions for hot paths, embedding for scriptable applications.
GUI Development: A Comparative Survey Frozen in Time
Chapter 23 devotes roughly 55 pages to Tkinter (standard library) and 35 to PyQt4. The Tkinter coverage is thorough: Frame subclassing, pack() geometry manager, control variables (StringVar, IntVar), event binding (<Modifier-Type-Detail>), core widgets, and supplementary modules (scrolledtext, filedialog, font, messagebox, simpledialog). The book notes Tkinter control variables accept invalid values silently; conversion errors surface only on get(). The pack() manager’s irreversible space allocation – early widgets claim space first – is correctly described.
The PyQt4 section covers signals/slots, layouts, Model-View architecture (an address-book example with QAbstractListModel, QListView, QItemDelegate), Designer/.ui files, and QPainter/QPen/QBrush graphics with gradients, anti-aliasing, and matrix transformations. PyGObject, PySide, and wxPython are surveyed; wxPython is noted as lacking Python 3 support at publication. Today, PyQt5/6 and PySide6 have different APIs (pyuic5/pyside6-uic, QtWidgets), and wxPython Phoenix supports Python 3 – a reminder of how thoroughly the GUI landscape shifted.
Performance Tooling Before the Modern Era
Chapter 22 establishes a three-level performance toolchain: timeit for microbenchmarks (emphasizing min(repeat(n, r)) over mean, disabling GC), cProfile for function-level profiling (ncalls, tottime, cumtime), and trace for line-execution counting and coverage analysis. The author cautions that algorithmic improvements outweigh syntactic tweaks – a principle that hasn’t changed.
The book surveys micro-optimizations: list comprehensions faster than for++= loops, hoisting attribute lookups for speedup, EAFP (try/except IndexError) faster than LBYL for index access beyond 30 elements, positional arguments faster than keyword arguments. These figures come from the author’s informal measurements on unspecified hardware; no statistical rigor, no PyPy/JIT consideration. They’re historical data points, not universal laws.
What the Book Misses – and Why That Matters
The limitations form their own catalog of Python’s evolution. No yield from (3.3), venv (3.3), asyncio (3.4), f-strings (3.6), pathlib (3.4), type hints (3.5+), match (3.10), tomllib (3.11), dataclasses (3.7). No pytest, mypy, modern packaging (pyproject.toml, wheel, build, PyInstaller/Nuitka). distutils appears as the packaging standard – deprecated in 3.10, removed in 3.12. cx_Freeze for frozen executables; PyInstaller and Nuitka now dominate.
Pedagogical gaps reveal what wasn’t considered essential then: memoryview, array.array, collections alternatives (defaultdict, OrderedDict, ChainMap), surrogateescape (PEP 383), dict subclassing/__missing__, selectors, TLS/SSL, OAuth2, high-DPI GUI, accessibility, theming (ttk). Security blind spots appear: eval in XML/DB examples flagged but not remediated; unsalted MD5 password storage demonstrated without warning; pickle insecurity noted but no safe alternative (e.g., json) shown for untrusted data; random vs. SystemRandom distinction made but no secrets module (3.6+).
Archaeology as Utility
For a modern reader, the book serves as a reference archaeology tool. Its domain-organized Part III provides a mental model of what the stdlib contained circa 3.3 – useful when reading legacy codebases or understanding why certain modules exist. Chapter 27’s 2to3 demonstration and exhaustive list of renamed/consolidated modules help diagnose porting issues in unmaintained 2.x code. The three-layer C-interop taxonomy clarifies trade-offs that persist. The threading+Queue worker-pool pattern remains the canonical pre-asyncio approach; the explicit GIL warning and multiprocessing pointer are historically accurate. The testing/debugging toolchain – doctest, unittest, cProfile/trace, logging, pdb – all demonstrated with minimal working snippets, shows a toolchain whose bones haven’t changed even as pytest and coverage.py superseded the defaults.
The CD-ROM is gone. The installers are obsolete. The Python 2.5 handbook HTML is a curiosity. But the structural decisions – teaching the object model first, organizing the library by task, treating migration as a core concern, presenting C interop as a spectrum – reflect a coherent philosophy about how practitioners learn and use a language. That philosophy, more than any specific API, is what the book preserves.