Pages
1645
Published
2013
Learning Python
A thorough introduction to Python language fundamentals, built for programmers who want to understand the language from the ground up
Master Python's core language — types, functions, classes, and modules — with the depth needed to write reliable, maintainable programs.
Learning Python by Mark Lutz is the definitive single-volume reference to the Python language itself. Across more than 1,600 pages, Lutz methodically covers every core language feature: built-in types, control flow, functions, modules, classes, exceptions, and the tools that tie them together. Whether you are writing your first Python script or trying to understand why your existing code behaves unexpectedly, this book gives you the mental model to reason clearly about the language.
About this book
Most Python tutorials get you writing code fast. That is useful, but it leaves gaps — gaps that surface as subtle bugs, performance surprises, and confusion when reading other people's code. Learning Python takes the opposite approach: it explains how Python actually works, not just how to get something running.
Mark Lutz has been teaching Python since the early 1990s. In this fifth edition, he walks through every significant feature of the language with the patience of someone who has watched thousands of students hit the same sticking points. The result is a book you can read cover to cover as a student or reach for as a reference when a built-in type does something you did not expect.
The book covers Python 3 throughout, with notes on where Python 2 differs — useful if you maintain legacy code or work in a mixed environment. You will not find web framework tutorials or data science libraries here. This is the language layer: the part that every Python program, regardless of domain, is built on top of.
- Built-in types in full: strings, lists, dictionaries, tuples, sets, and the operations that matter
- Functions from first principles: scopes, closures, generators, decorators, and argument-passing mechanics
- The module and package system explained clearly enough to end import confusion permanently
- Object-oriented Python: classes, inheritance, operator overloading, and the attribute lookup chain
- Exceptions and the context manager protocol as tools for writing robust code, not just error handling
- Advanced topics including metaclasses, descriptors, and managed attributes for readers ready to go deeper
At 1,645 pages, this is not a weekend read. It is the book you keep on the desk and return to when a language feature surprises you. If you want to know Python rather than merely use it, this is the reference that earns its shelf space.
🎯 What you'll learn
- Understand how Python's core data types are implemented and when to use each one
- Write functions that use closures, generators, and decorators correctly and confidently
- Navigate Python's scoping rules without guessing what name resolution will do at runtime
- Structure code with modules and packages so that imports behave predictably across a project
- Build class hierarchies that use inheritance and operator overloading without surprising side effects
- Handle exceptions and context managers in a way that keeps resources safe and errors visible
- Apply advanced features such as descriptors, metaclasses, and managed attributes when the problem actually calls for them
👤 Who is this book for?
- Programmers new to Python who want a thorough grounding in the language rather than a quick-start tutorial
- Developers coming from another language who need to understand Python's specific object model and scoping rules
- Intermediate Python writers who have gaps in their knowledge of built-in types, closures, or the class system
- Engineers maintaining Python 2 codebases who need a clear map of what changed in Python 3
- Technical readers who prefer exhaustive explanation over concise examples and want to understand the why, not just the how