New
High Performance Python
Practical Performant Programming for Humans
by Ian Ozsvald, Micha Gorelick
Pages
1269
Published
2025
A thorough reference to Python language fundamentals, from syntax and data types to classes and advanced tools
Work through Python's core language from first principles to advanced features, so you can write code that is correct, readable, and maintainable.
Learning Python by Mark Lutz is the definitive reference for anyone who wants to understand Python from the ground up. At 1,269 pages, it goes far beyond crash courses: covering types, statements, functions, modules, classes, exceptions, and advanced tools with the depth needed to write production-quality code. Whether you are new to programming or moving to Python from another language, this book gives you the mental models to reason about code, not just copy it.
Most Python tutorials teach you enough syntax to get something running. This book teaches you enough to understand why it works, and what to do when it does not. Mark Lutz has spent decades teaching Python, and Learning Python reflects that accumulated precision: every concept is built carefully on the one before it, with examples designed to expose the edges of the language rather than hide them.
You will start with Python's execution model and move systematically through its built-in types, control flow, and function system. From there the book covers modules and packages, object-oriented programming with classes and inheritance, exception handling, and the decorator and metaclass features that underpin most major frameworks. Each section includes exercises and quizzes to confirm understanding before you move on.
The book is unapologetically thorough. If you want a 50-page introduction to Python, this is not it. If you want to finish a book and genuinely understand what Python is doing when it runs your code, this is exactly it. The depth here pays dividends when you move on to any specialised domain: web development, data science, automation, or systems scripting.
At 1,269 pages this is a reference you return to as your skills grow. Chapters that felt dense on first read become reference material once you are working on real projects. Many working Python developers keep a copy on the desk precisely because the index and depth reward repeated consultation.
Published by O'Reilly Media, the book meets the editorial standard readers expect for precision and accuracy. If you are serious about Python as a tool, this is the foundation text.
You set up a working Python environment and run your first scripts. The chapter explains CPython's execution model so you understand what happens between writing code and seeing output.
You work through Python's core built-in types: numbers, strings, lists, tuples, dictionaries, and sets. You learn how Python's dynamic type system works and why it matters for correctness.
You cover the full set of Python statements, including assignments, conditionals, loops, and comprehensions. The chapter shows how Python's indentation-based syntax enforces structure.
You build a deep understanding of Python functions: how scopes work, how closures capture state, how generators produce values lazily, and how lambda and map-style tools fit the language.
You learn how Python's import system works, how to structure code into reusable modules and packages, and how to avoid the namespace collisions that trip up larger projects.
You build classes from scratch and work through inheritance, method resolution order, and operator overloading. The chapter explains Python's object model precisely, not by analogy.
You learn to raise, catch, and design exceptions that make failures explicit and recoverable. The chapter covers the full exception hierarchy and context managers.
You implement decorators that wrap functions and classes, then explore metaclasses as the mechanism behind class creation. The chapter demystifies tools that most frameworks rely on heavily.
You examine string encoding, managed attributes, descriptors, and other advanced mechanisms. The chapter prepares you to read and contribute to code that uses Python's more powerful features.
Some familiarity with basic programming concepts is helpful. Readers who are completely new to programming can follow along, but the book moves at a deliberate pace rather than a beginner-hand-holding one. Prior experience with any scripting or programming language makes it easier.
This edition covers Python 3. Legacy Python 2 differences are noted where they are significant for readers working with existing codebases.
It is primarily a language reference, not a project-based tutorial. You will write a great deal of code in exercises and examples, but the goal is thorough understanding of the language rather than shipping a specific application.
Yes. Many readers who already know enough Python to get things done use this book to understand why things work the way they do. The sections on scopes, the class model, decorators, and metaclasses are valuable well beyond beginner level.
Shorter books trade depth for speed. This book covers the same starting material and then continues far further into the language. If your goal is a solid mental model of Python rather than getting something running quickly, the extra pages earn their place.
Yes. Each part of the book includes quizzes and exercises so you can verify your understanding before moving on to the next topic.
New
Practical Performant Programming for Humans
by Ian Ozsvald, Micha Gorelick
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
New
Clear, Concise, and Effective Programming with Python's Most Powerful Features