New
High Performance Python
Practical Performant Programming for Humans
by Ian Ozsvald, Micha Gorelick
Pages
242
Published
2018
Best Practices for Writing Maintainable, Scalable Python
Move beyond beginner Python and ship code that holds up in production — structured, fast, and built to last.
Serious Python bridges the gap between knowing Python syntax and writing code that works in real teams and real projects. Julien Danjou, a longtime Python core contributor, walks you through project structure, packaging, testing, performance profiling, and advanced language features. At 242 pages, it stays focused and actionable — no filler, no toy examples, just the practices that distinguish a competent Python developer from a careful one.
Most Python tutorials stop at the syntax. They show you how to write a loop, define a class, or open a file. What they skip is everything that happens when your code has to live in a repository, survive a code review, run in production, and get maintained by someone else six months from now.
Serious Python fills that gap. Written by Julien Danjou, a Python core contributor and veteran open-source developer, the book covers the judgment calls that intermediate developers need to make every day: how to structure a project, how to package and distribute code properly, how to test without writing brittle tests, how to profile before optimizing, and how to use the language features that most tutorials never reach.
The material is direct and concrete. Each chapter addresses a specific area where Python developers most commonly plateau: module organization, documentation, type handling, functional programming tools, context managers, decorators, and the internals of how Python runs your code. You will come away understanding not just what to do, but why a given approach holds up under real conditions.
This is not a reference manual. It does not cover every module in the standard library or attempt to be exhaustive. It is a focused, 242-page argument for writing Python more carefully — and it gives you the tools to do exactly that.
Learn how to lay out a Python project from the start, configure setup.py and pyproject.toml, and publish a package that others can install reliably.
Understand how Python's import system works, how to organize code across modules, and when to reach for a framework versus a library.
Set up Sphinx to generate reference documentation from docstrings and write documentation that stays in sync with the code as it evolves.
Handle dates and times correctly by understanding naive versus aware datetime objects and avoiding the common bugs that come from ignoring time zone context.
Write a practical test suite with pytest, use fixtures to manage shared state, and apply mocking to isolate the code you actually want to test.
Master Python's method types — instance, class, and static — and write your own decorators that compose cleanly without swallowing stack traces.
Use itertools, functools, and generator expressions to write data-processing code that is shorter, faster, and easier to reason about than equivalent imperative loops.
Learn when to use ABCs to enforce interfaces, how Python's MRO determines method lookup, and how to use duck typing without sacrificing clarity.
Profile a real Python program with cProfile and line_profiler, interpret the output, and apply targeted optimizations rather than guessing at bottlenecks.
Explore how CPython executes your code, what the GIL means for concurrency, and how understanding the runtime helps you write more efficient programs.
The book was published in late 2018 and targets Python 3. Most of the practices and language features covered are stable and still current, though some packaging tooling details have evolved since publication.
You should already be comfortable writing basic Python — functions, classes, file I/O. This book is aimed at developers who know the syntax but want to write better-structured, more maintainable code. It is not for absolute beginners.
It works both ways. The chapters are largely independent, so you can jump to the topic most relevant to you. Reading cover to cover also makes sense because the chapters build a consistent picture of professional Python practice.
Yes, concrete code examples are central to every chapter. The examples are short and focused — they illustrate one idea at a time rather than building a large application across the book.
The core topics — project structure, testing, decorators, profiling, the object model — have not changed significantly. Some tooling recommendations around packaging and type hints reflect 2018 conventions, so you may want to cross-reference current docs for those specifics.
New
Practical Performant Programming for Humans
by Ian Ozsvald, Micha Gorelick
New
A thorough reference to Python language fundamentals, from syntax and data types to classes and advanced tools
by Mark Lutz
New
A Hands-On, Project-Based Introduction to Programming in Python
by Eric Matthes
New
A Concise Desktop Reference for Python 3 — Language, Libraries, and Best Practices
by Alex Martelli, Anna Martelli Ravenscroft, Paul McGuire, Steve Holden