New
High Performance Python
Practical Performant Programming for Humans
by Ian Ozsvald, Micha Gorelick
Pages
771
Published
2023
A Concise Desktop Reference for Python 3 β Language, Libraries, and Best Practices
Get a definitive answer to any Python question fast, from core syntax and data structures to the standard library and modern best practices.
Python in a Nutshell is the working reference you keep open while you code. Covering Python 3 in depth, it gives you authoritative, precise answers on language semantics, built-in types, the standard library, and the idioms that experienced Python developers rely on daily. Whether you are debugging a subtle scoping issue, reaching for the right data structure, or navigating the standard library without guessing, this book delivers the answer without making you wade through a tutorial.
Some books teach you Python. This one is the one you reach for after you already know Python and need to get something right. Python in a Nutshell, written by four experienced Python practitioners and published by O'Reilly, is a dense, accurate, desktop reference covering the full Python 3 language and a broad cross-section of its standard library.
The book is organized the way a working programmer thinks. You can start at the language reference chapters to resolve a question about variable scope, object model behavior, or descriptor protocol, then move to the library chapters to find the right module and understand its interface without hunting through online docs. Every section is written to be read on its own, so you can jump in wherever your current problem takes you.
Coverage spans the core language thoroughly: types and objects, expressions and statements, functions and closures, classes and metaclasses, exceptions, iterators, generators, and the async model introduced in modern Python 3. The library chapters cover I/O, text handling, data formats, networking, concurrency, and more β chosen for practical relevance rather than encyclopedic completeness.
At 771 pages, this is not a lightweight pamphlet. It earns the shelf space by being the most reliable single source you can consult when the answer actually matters. If you write Python regularly, this book pays for itself the first week you use it.
Sets up the environment and introduces the Python interpreter, covering installation, the interactive shell, and how Python finds and executes code.
Covers core language syntax: literals, variables, expressions, statements, control flow, and the rules that govern how Python evaluates and executes code.
Examines Python's built-in types in depth β numbers, strings, bytes, lists, tuples, sets, and dictionaries β with precise behavioral details for each.
Explains function definition, argument passing, closures, decorators, and the functional programming tools available in the standard library.
Covers classes, inheritance, the descriptor protocol, metaclasses, and the full Python data model so you can predict and control how objects behave.
Describes Python's exception hierarchy, how to raise and handle exceptions correctly, and how to write context managers with both classes and generators.
Explains the iterator protocol, generator functions and expressions, and Python's async model including coroutines, tasks, and the asyncio event loop.
Surveys the most useful standard-library modules across I/O, text, data formats, networking, and concurrency with enough detail to use them without guessing.
Shows how to write C extension modules and embed the Python interpreter in a larger application, with practical guidance on the CPython C API.
Walks through the tools and conventions for packaging Python projects, declaring dependencies, and publishing to PyPI for others to install.
The fourth edition covers Python 3, reflecting modern language features including type hints, asyncio, and current standard-library interfaces. Python 2 is not the focus.
No. This is a reference and mid-to-advanced practitioner guide, not a tutorial. Readers who already write Python day-to-day will get the most out of it.
Yes, the text includes code examples throughout to illustrate language behavior and library usage. Check O'Reilly's companion page for any downloadable materials.
It is not designed for beginners. If you are learning Python for the first time, a tutorial-style book will serve you better before you reach for this reference.
The book provides curated, cross-referenced, editorially reviewed coverage written by experienced practitioners, with context and judgment that raw reference docs do not offer.
The focus is the Python language itself and the standard library. Third-party frameworks and scientific libraries are outside its scope.
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
Clear, Concise, and Effective Programming with Python's Most Powerful Features