ŷ

Jump to ratings and reviews
Rate this book

Fluent Python: Clear, Concise, and Effective Programming

Rate this book
Python’s simplicity lets you become productive quickly, but this often means you aren’t using everything it has to offer. With this hands-on guide, you’ll learn how to write effective, idiomatic Python code by leveraging its best—and possibly most neglected—features. Author Luciano Ramalho takes you through Python’s core language features and libraries, and shows you how to make your code shorter, faster, and more readable at the same time.

Many experienced programmers try to bend Python to fit patterns they learned from other languages, and never discover Python features outside of their experience. With this book, those Python programmers will thoroughly learn how to become proficient in Python 3.

This book

Python data understand how special methods are the key to the consistent behavior of objectsData take full advantage of built-in types, and understand the text vs bytes duality in the Unicode ageFunctions as view Python functions as first-class objects, and understand how this affects popular design patternsObject-oriented build classes by learning about references, mutability, interfaces, operator overloading, and multiple inheritanceControl leverage context managers, generators, coroutines, and concurrency with the concurrent.futures and asyncio packages understand how properties, attribute descriptors, class decorators, and metaclasses work

794 pages, Kindle Edition

First published January 25, 2015

1,378 people are currently reading
5,810 people want to read

About the author

Luciano Ramalho

2books74followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
1,192 (70%)
4 stars
386 (22%)
3 stars
97 (5%)
2 stars
14 (<1%)
1 star
5 (<1%)
Displaying 1 - 30 of 134 reviews
Profile Image for Jascha.
151 reviews
January 2, 2020
Among the books that are currently populating my Goodread's wishlist are no less than 20 titles dedicated to the Python language. They range from Django up to pandas, passing through Twisted and Test-Driver Development. Time is limited, so they often end up waiting in queue for months. But when I've seen Fluent Python on that shelf I had to make it mine immediately and put it in front of that queue. Getting through this book took me several months, not only because we are talking about some 700 hundreds good pages, but mostly due to the fact that it covers advanced topics that most of the Pythonists currently living on planet Earth never heard of in their life. Fluent Python is one of those books that you must taste little by little or you get devoured by those fierce topics and examples.

Released late this summer, Fluent Python is the latest work of Ramalho, a name that should sound familiar to those that have been already diving deeply into, allow me the term, Python's high-end features, powerful things, such as coroutines, that most developers never heard of in their life. Those that did probably hope never being tested on them during a job interview. And that's pretty much what the book is all about. Neither style nor the the basics of the language, but very advanced features. Quite a rare book indeed, since almost all of the Python books available introduce the readers to the language and don't get past Object Oriented Programming.

An excellent text overall, no doubts. Not for the faint of heart. Still, I am a bit puzzled by the fact that some chapters look extremely simple, others cover quirks and intricacies that you can probably live without, unless you dare touching the very core of the language ,and that get you to reach the end of a chapter with that what the hell expression on your face. The chapter covering abstract classes is an example of the former. Don't get me wrong, it's interesting and the examples well laid out. Still, it looks a basic concept that doesn't fit this kind of book.

A couple of words on the examples: they are throughout the whole book well done. The author often presents the same concepts in different flavors or does work on the same example and improves it as concepts are taken into the discussion. The code is intense but easy to follow. Key lines are extensively explained later on, so that the reader won't miss that specific features that makes it all possible. There are so many gems that you will probably end up writing most of that code down to make it yours. This is actually the best thing the reader can do. Try it, modify it, assimilate it, master it.

Among the many topics covered there are two that are worth mentioning: the first is chapter four, which covers strings, Unicode and bytes. Marvelous, simply marvelous. The examples, the explanations. So clear and to the point. You definitely get away from it with a deep understanding of how strings work in Python 2.7 and 3. The second is that dedicated to futures. Actually it's the whole topic, which spans several chapters at the very end of the book. The authors shows how working with threads and subprocesses improve the efficiency of an application, and how easy it is to exploit them through the futures that are now available in the language. He does gives us a very interesting example in many different flavors, showing us how the code and performance change. Great.

Decorators and closures are also well described, even if not as good as the aforementioned topics. In that sense, the author does complement what we find about the subject in Effective Python: 59 Specific Ways to Write Better Python, another must have for any serious Pythonist.

Overall, a great Python book. A must have for any Python developer interested in getting the most out of the language.
Profile Image for Amir Tesla.
162 reviews760 followers
December 28, 2021
This book is a deep dive into the inner workings of the python language. It covers all the topics of python, from primitive data types to advanced metaprogramming with great detail and example.

The first edition covers python 3.5 and the second edition covers python 3.10. The second edition additionally covers @dataclass, the new asyinc-await syntax in concurrency, type annotations, and much more.

Chapters' contents are written from bottom to top. Namely, each concept is first explained with simple examples and advances to a more complicated form, built on top of what's already said. So, I'd advise you to read chapters page by page.

If you read this book, you'll be able to answer almost all python-specific questions in the interviews. It would also teach you great features that are specific to python which maybe absent in other languages

All in all, I think this book is a must-read if you want to gain a true mastery in python

Be advised: This is not a beginner's book at all, you'd better have at least 2-3 years of python experience before jumping into code.
Profile Image for Renan Ivo.
20 reviews3 followers
August 20, 2019
It is always a pleasure to read books writen by people who really understand a programming language an have good didactics. This book is one of these.

The author writes about Python with passion but without hiding its flaws and pitfalls. As I read it, I could understand some concepts that seemed a little "magical" to me and discover that some concepts didn't work the way I thought.

I recommend this book to everyone who already knows Python but wants to understand it for real.
Profile Image for Emre Sevinç.
173 reviews422 followers
December 24, 2021
"Fluent Python - Clear, Concise, and Effective Programming, 2nd Edition" by Luciano Ramalho is one of the best Python books I've read since I started programming in Python back in 2007.

But I have to warn you that it is probably not the first, not even the second book you should read if you're getting started with Python. Even if you're an experienced programmer coming from a different programming language background, there are other resources to help you get up to speed with Python and showcase its good use for domains ranging from machine learning and deep learning to system administration, automation, DevOps, network management automation, etc. as well as general Python performance tuning and best practices.

This book deserves a slow reading and experienced Python programmers will appreciate the insights provided by the author: It's been more than 6 years since the first edition and Python language itself with its standard library progressed a lot, sometimes at a breakneck speed. For experienced software developers and Python programmers who want to dive deep into the core language features of Python in 2022 and upcoming years, this book is probably the perfect reference.

A careful reading shows that the author not only knows the core topics of the book very well, but also has a very good grasp of history and context of other influential programming languages, e.g. when refers to the mind-blowing , or when he compares the some aspects of concurrent programming in Python to Java and Go.

Another shining feature of the book is the amount of careful thought and effort spent on pedagogy, building crystal clear examples and contrasting different approaches to really drive home the message in chapters such as "1. The Python Data Model", "5. Data Class Builders", "17. Iterables, Iterators, and Generators", "20. Concurrency Models in Python", "21. Concurrency with Futures", and "22. Asynchronous Programming". The chapters on optional typing and type hints also deserve similar praise.

I found myself marking a lot of sections, taking notes and visiting almost every resource mentioned in "Further Reading" section of each chapter. The author did a great job for directing the reader to more specialized books as well as online tutorials, guides, HOW-TOs, presentations and videos.

I can easily imagine myself coming back to some of the chapters not only to solidify my understanding about some core and modern Python features but also referring to them when I'm discussing issues with fellow software developers and automation experts (in fact, I already referred to this book more than once during such discussions!).

Python programming language will turn 31 years old in 2022, and as long as it continues to attract such great authors showcasing its features, the friendly and knowledgeable community will continue to grow and attract software developers from all walks of life. Let's enjoy such nice books and go build clear, concise, and effective solutions to all sorts of automation problems! ;)
81 reviews9 followers
September 2, 2016
I've just now finished reading this awesome book!

It took me several months (started reading the early release in January), there is a richness of information that it's probably a good idea to interleave with some practice to let the information sink in.
The book helped me greatly, because throughout the period I've been doing a lot of not only coding but also code reviewing, and I feel I've grown a lot as a programmer in the process.

One of the great things about this book is that after showing you the main points, it has pointers to great curated material for further reading. This also explains why it was hard for me to finish it: I got distracted reading some of the pointed resources. =)

A minor nitpicking about the printed edition is that sometimes the text references color in figures which aren't colored (at least in my copy) -- a small thing that doesn't compromise the overall experience and something I hope is fixed in the next printed editions.

If you're a Python programmer wanting to improve your chops, this book is what you want: it's a deep dive into the Python way, your designs will be better after this, your code will be more powerful, concise and probably easier to read too. It will help you to avoid many common traps that people coming from other languages are prone to fall into.

Anyway, it has been a marvelous investment reading the book through the end, I'm pretty sure I'll be coming back to it. ;)
Profile Image for Nico OooooMyyyy.
7 reviews5 followers
January 15, 2021
To the reader wondering whether they should wait for the 2nd Edition releasing in September this year...

DON'T WAIT, READ IT NOW!

This book still absolutely holds up, there are just a couple things to note.

Chapter 3 on dictionaries needs a bit of an update since the implementation is now a compact dictionary, which is different from the Python 3.4 dictionary.

I am curious to see Ramalho's editing on the coroutines and asyncio chapters. He's right on the fact that coroutines are syntactically confusing in Python, but with asyncio's introduction with await and async declaration, I wonder if there will be any structural changes to the chapter.

Lastly, the latter half of Chapter 21 on Class Metaprogramming will be edited. Metaclass programming is confusing to begin with, and the omission of __init_subclass__ due to being Python 3.4, makes this concept even harder to apply.

Other than that, this book still feasts and will ultimately change your perspective on programming in Python. I'd consider reading Slatkin's Effective Python 2e before or concurrently with this book.

Also, you can make an O'reilly account and see the unreleased version of the 2nd edition. As of now, he is at Chapter 16 (?). There is a new chapter on Type Annotations and Data Classes.

Profile Image for Vishwanath.
44 reviews6 followers
February 4, 2017
Highly recommended for intermediate python programmers. Some of the material is heavy and does take work and additional research to sink in as the author explores the heart of the language under the covers. I also found some material incomprehensible - more so due to my own inexperience. But complex chapters are explained clearly with tons of examples and also historical context which is an added bonus. Particularly enjoyed the chapter on Dynamic attributes with excellent examples on reading JSON effectively. Another notable chapter was Concurrency with futures which had highly practical examples of scripts downloading files using threads to illustrate the concept. Overall, a great reference to own and go back to while dealing with challenging concepts.
Profile Image for Thabs.
105 reviews
April 7, 2021
This is excellent reference material for intermediate to advanced Python programmers looking to deepen their understanding of the many functions and layers of Python.

Profile Image for Martin Votruba.
8 reviews
March 23, 2021
The book aims to explain some more intricate aspects of Python and the standard library. The author does great job explaining technical topics and conveys how true pythonic code should feel like. All chapters are well structured, likewise the presented code is well arranged and commented. At the end of each chapter the content is put into context of other programming languages, which I found tremendous. The book is very captivating; I was drawn to it as if I had been reading a novel. I would highly recommend it to anyone who want to get comprehensive introduction to the world of Python (basic knowledge is imperative though).
5 reviews
February 8, 2025
some useful tidbits but overall I thought too lengthy for the value I got from it
Profile Image for John Ferngrove.
80 reviews3 followers
October 23, 2022
Of course, we programmers know that everything we could want to know is out there, in fragmentary form, on the web. But I have a tediously fastidious mind that likes to keep the distinction clear between what I know and what I have yet to find out. As such, books are my preferred approach to a systematic learning process. I would have been very grateful then if someone had told me at the start of my Python journey that what and all I needed to read was the Tutorial at python.org, David Beasley's epically concise Python Distilled, and this, the 'lizard book'. This book demands a close, paragraph by paragraph reading and maybe some re-reading of some sections till full or at least deeper understanding dawns. After this book there isn't really anywhere to go except the source code and the dry and voluminous language docs. Whatever isn't actually in the book is there on the accompanying fpy.li website.

A first point is that this is not a book for the beginner. One needs to have a reasonable grasp of the language having worked a while with it, being able to muddle along, but also knowing one is just muddling along and wishing to get things onto a more solid foundation.

As such, I'm anxious not to let prospective readers be put off by the review that asserts that the author does not get to the point. There is no flab in this book. It is a big book, but a serious programmer could only wish that the book was even bigger and even more detailed. Python is as much an ideology about how to do things properly as a programming language. It is deceptively easy to muddle along in Python on the basis of what one has already come to know in more 'primitive' programming languages. But for the programmer determined to get the best from a language that has a near endless toolbox of subtle features and constructs the learning curve goes far deeper and longer than a superficial comprehension can suspect. Perhaps that reviewer is thinking about the soapbox sections at the end of each chapter in which the author considers the merits or not of particular decisions made in the complex, democratic language design process? If so, it should be pointed out that even here the author is inviting the reader to think more deeply and clearly about why such features were implemented as they were and what the alternatives might be.

I have two complaints, notwithstanding which I still regard the book as indispensable and insubstitutable. Firstly, I wish very much there was a hardcover edition because the kind of reading this book demands means that the paperback cover is not going to survive even as much as a first reading. I would also like to see, perhaps in a future edition, a more comprehensive and systematic index. Again and again, one encounters situations where we know we have read something about this in 'the lizard book' but finding the requisite nugget or gem is not always that easy. The book does not work particularly well as a reference.

A final point is that the book is a great pleasure to read without any loss of clarity. Although the author's knowledge is clearly formidable, he invites the reader to accompany him on a journey as a fellow traveller, pointing out the many small discoveries he has made in his own passage. One quickly comes to feel assured that even where one's own understanding might falter, everything you need to achieve understanding is written down there if one just reads it carefully enough. Few technical authors pass this test. The man is a natural teacher who always places himself in the point of view of the student and proceeds from there.

A huge, rigorous, fractally detailed but profoundly enjoyable journey of a book. As simple as possible but no simpler. The mighty and beautiful 'lizard book'
3 reviews7 followers
February 28, 2024
أكتر كتاب هيفهمك اللغة بشكل عميق ويعرفك على كل إمكانيتها وتفاصيلها بأسلوب ممتع.
كتاب عملي وفيه أمثلة وكود كتير.
الترشيحات اللي في آخر كل شابتر سواء مقالات أو كتب ممتازة.

خدت الكتاب في شوت واحد؛ ﻷن� من الكتب اللي عشان تمتص المعلومات اللي فيها محتاج تحطها في سياق عملي. فأنسب طريقة بالنسبالي مع الكتاب هي إني أرجع للمعلومة وقت ما أحتاجها.
Profile Image for Reece Mathews.
24 reviews
July 21, 2020
finally read this cover to cover (only took me two years!). a couple of things:

Python is a beautiful language. as this book notes, it’s easy for beginners and practical for professionals. the language has insane depth and capability while maintaining its simplistic and predictable syntax/design in even its more obscure components (and without preferring consistency too much over usability).

the book itself is really well written. it does a very good job of covering a very wide variety of more intermediate topics with real-world examples. as someone with a pretty decent amount of experience in python, it was nice to read something less targeted towards beginners.

now if only I could convince myself to actually really do something with this knowledge haha :/
Profile Image for Sivachandran Paramasivam.
14 reviews3 followers
October 28, 2021
Excellent book for experienced programmer who wants to learn Python in-depth.

I have been writing Python for more than a decode. But I never considered myself a Python programmer as I never spent effort and time to understand the design philosophies and underlying design of Python.

Fluent Python, unlike other books, doesn't bore you with the language syntax and how to write Python for common programming function. Instead, it teaches the Python's underlying idea behind Python and discusses the pros/cons comparing with other programming languages. It also teaches the Pythonic way of achieving common programming tasks.
1 review
April 25, 2020
Best book about programming language I've read so far. Although a bit aged, it surely isn't outdated. A lot of the concepts discussed in the book are still valid. It teaches not only how to write an idiomatic Python code, but also some of the inner workings of the language/interpreter itself. Looking forward to the 2nd edition.
217 reviews12 followers
July 13, 2024
I appreciated this book and learned a lot while reading it. Certainly topics I've encountered while working with Python but skimmed over. The book also touches some dusty corners (dusty corners of the Python language, which isn't the fault of the book, looking at you metaprogramming). What I personally didn't like about this book is that each chapter needs to start with 'how is this chapter different from the previous edition' which is in my opinion a waste of space.
45 reviews2 followers
April 11, 2022
Good Python programmers ("pythonists") know how to use Python features in ways not usual in other languages to achieve greatness. This is what this book is about. It covers a lot of ground, but it is not a cookbook or a collection of tricks. You will find not only in deep descriptions of Python features but, sometimes more important, why they exist the way they are.

It is a long book, but the writing is so good it is a joy to read. Examples are jewels of simplicity, clarity and flexibility.

Just make sure that you are ready for this book. This is not a book for beginners, you will need some experience with programming and with Python to fully appreciate it.
Profile Image for Maurício Gardini.
12 reviews7 followers
July 13, 2021
One of the best programming books that I read.

It is very complete and very dense, so I recommend reading it slowly, taking notes and practicing as you go.

Great book to have as a reference too.
Profile Image for Giulio Ciacchini.
345 reviews10 followers
September 27, 2024
Such a great textbook to look under the hood of Python's engine.
As it often happens with more advanced books, the latest chapters are a bit too complex for me, but overall the structure of the book is very good.
The book delves into Python’s underlying mechanics and advanced constructs, guiding developers to write cleaner, more Pythonic code by leveraging the language’s built-in capabilities. Ramalho does a deep dive into Python’s core features, including data structures, functions, objects, metaprogramming, and concurrency, while emphasizing the importance of understanding Pythonic idioms and best practices.
I've also appreciated the approach of putting first some technical details that are often overlooked, such as:
Special methods in Python, often referred to as "magic methods" or "dunder methods" (short for "double underscore"), are methods that have double underscores at the beginning and end of their names, like __init__, __str__, and __add__. These methods are used to enable certain behaviors and operations on objects that are instances of a class. They allow you to define how your objects should respond to built-in functions and operators.

or
A hash is a fixed-size integer that uniquely identifies a particular value or object. Hashes are used in many areas of computer science and programming, such as in data structures like hash tables (which are used to implement dictionaries and sets in Python). The purpose of hashing is to quickly compare and retrieve data in collections that require fast lookups.
- Python provides a built-in hash() function that returns the hash value of an object.
- The hash() function works on immutable data types like integers, floats, strings, and tuples.
- For mutable types like lists or dictionaries, hash() is not applicable because their contents can change, making them unsuitable for use as keys in hash-based collections.
- The hash value of an immutable object (like a string or a tuple) remains constant throughout the program's execution, provided that the object itself doesn't change.
- Mutable objects cannot be hashed because their contents can change, leading to inconsistencies in hash values.
- Hashes are crucial for the performance of dictionaries and sets in Python. When you insert an item into a dictionary or set, Python uses the hash value to determine where to store the data. This allows for very fast lookups.
Dictionaries themselves are not hashable. This is because dictionaries in Python are mutable objects, meaning their contents can change after they are created
Keys must be hashable: This is a strict requirement because dictionaries use a hash table internally to store key-value pairs. The hash value of the key determines where the pair is stored.
Keys must be immutable: This immutability ensures that the hash value of a key remains consistent throughout its lifetime. If the key could change, it would disrupt the dictionary's internal hash table, leading to unpredictable behavior when trying to retrieve or store values.
The key in a dictionary cannot change directly because keys in a dictionary must be immutable. This means that once you assign a key to a dictionary, it must remain unchanged.
However, if you want to "change" a key, you would need to remove the old key-value pair and add a new key with the same value (or a modified value).


The Python Data Model:
The book starts by explaining Python’s data model, which is the foundation for everything in Python. It explores how to define and customize objects, and how Python��s magic methods (like __repr__, __str__, __len__, etc.) can be used to make objects behave consistently with Python’s expectations.
You’ll learn how Python leverages special methods for operator overloading, object representation, and protocol implementation.

Data Structures:
Ramalho provides a thorough review of Python’s built-in data structures such as lists, tuples, sets, dictionaries, and more. He explains how to efficiently use these structures, as well as advanced concepts like comprehensions, slicing, and sorting.
He also introduces custom containers, how to create immutable types, and how to use collections to implement advanced data structures like namedtuple and deque.

Functions as Objects:
The book explores first-class functions, demonstrating how functions in Python are objects and can be used as arguments, returned from other functions, or stored in data structures.
Concepts such as closures, lambda functions, decorators, and higher-order functions are explained in detail, showing their importance in building flexible, reusable code.

Object-Oriented Idioms:
Fluent Python emphasizes writing idiomatic object-oriented code and explores Python’s approach to object-oriented programming (OOP).
Topics covered include inheritance, polymorphism, interfaces, protocols, mixins, and abstract base classes (ABCs). The book discusses how to design flexible class hierarchies and how Python’s OOP system differs from other languages.

Interfaces, Protocols and ABCs
Duck typing is a dynamic typing concept based on the idea of "if it looks like a duck and quacks like a duck, it must be a duck." This means that the type or class of an object is determined by its behavior (i.e., the methods it implements) rather than its explicit type. In other words, if an object implements the necessary methods or properties required by the context, it's considered valid, regardless of its actual class or type.
No explicit type checks: Python doesn't require you to declare the type of an object, and duck typing allows you to use any object that has the required methods.
Runtime flexibility: Duck typing checks happen at runtime, so the system checks the object's methods or attributes during execution.
Error prone at runtime: Since there are no compile-time checks, errors related to missing methods are only discovered when the program is executed.

class Duck:
def quack(self):
print("Quack!")

class Dog:
def quack(self):
print("Bark that sounds like a quack!")

def make_it_quack(animal):
animal.quack() # Works as long as 'animal' has a 'quack' method

duck = Duck()
dog = Dog()

make_it_quack(duck) # Output: Quack!
make_it_quack(dog) # Output: Bark that sounds like a quack!

Goose typing (sometimes referred to as gradual typing) is an extension of duck typing that adds more structure by explicitly checking whether objects conform to a given interface, but without strictly requiring them to belong to a specific class or type. The term "goose typing" isn't as commonly used as duck typing or static typing but can be thought of as a middle ground between the two.
In Python, goose typing can be implemented through tools like protocols and abstract base classes (ABCs). These mechanisms allow objects to be treated as valid types if they conform to a specific interface, regardless of their concrete type.


Metaprogramming:
Metaprogramming is one of the most advanced topics in Python, and the book provides a detailed exploration of how to write code that modifies or generates other code at runtime.
Descriptors, properties, class decorators, and metaclasses are discussed in depth, offering insight into how Python’s internals work and how to leverage them to write dynamic, reusable, and adaptable code.

Concurrency:
Ramalho also addresses concurrency and introduces several approaches for handling parallelism and concurrency in Python, including threading, multiprocessing, asynchronous programming with asyncio, and the concurrent.futures module.
The book provides examples of how to work with I/O-bound and CPU-bound tasks efficiently, using appropriate concurrency models.

Generators and Coroutines:
Generators and coroutines are powerful tools in Python for managing state and producing data on demand (lazy evaluation). Fluent Python covers the use of generators for iterating over sequences and using coroutines for writing asynchronous code in an intuitive way.

Decorators and Context Managers:
Fluent Python covers decorators and context managers extensively, explaining how they work and how they can be used to implement cleaner, more readable code.
The book covers the @property decorator, function decorators, and class decorators, as well as how to use with statements and implement custom context managers.

Design Patterns:
The book touches on common design patterns in Python and how they can be implemented in a Pythonic way. This includes patterns like Strategy, Observer, and Command, as well as more Python-specific approaches like duck typing and protocols.
Profile Image for Renton.
5 reviews
January 28, 2023
This is an incredible book for those coming in with an already intermediate knowledge of python.

The author Ramalho has a very distinct and personal way of writing, almost as if he is your peer helping you work through the concepts rather than a teacher. There are also numerous excerpts and tid-bits about the history of python and the developers that have contributed to it. He really makes you feel like you are a part of the python community just by reading, which I have never experienced from a textbook before.

A lot of the language features and concepts he goes over are really not the sort of things most developers will be writing in their day-to-day work (unless you are creating frameworks), and the author is the first to admit that many of the features you really *shouldn't* be using unless you are creating frameworks. Still, it is invaluable to truly understand the inner workings of the language, and to get a feel for the magic that is going on behind the scenes of your favourite libraries.

This is an essential read for anyone hoping to take their python learning and understanding to the next level. The sections on concurrent programming were in particular eye-opening as I think many developers may be used to asynchronous paradigms in javascript, but have never applied them to their python projects before.
Profile Image for Ben Hughes.
36 reviews
March 17, 2018
Outstanding advanced coverage of the Python language by a deep expert.

Sometime it's difficult to find learning resources that go beyond the beginner/intermediate material covered well by most programming books. Luciano covers a smattering of intermediate/advanced Python topics in "Fluent Python" that is exactly what I was looking for after reading "Introducing Python" and "The Hitchhiker's Guide to Python". Of particular interest are the chapters on Iterables/Iterators/Generators, Coroutines, and Attribute Descriptors. Learning that methods are merely bound functions partially applied to "self" via a attribute descriptor (with __get__) was a big "ahah" moment for me in understanding the Python data model.

If I had to offer one criticism, it would be the format in which sometimes lengthy code samples are annotated - using numbers causes the reader to constant flip back and forth in a way that's somewhat jarring. I'd much rather there just be in-line comments that explain the progression of code.
9 reviews
June 14, 2017
One of the best Python books I've read, and one of the best tech books generally I've read. With a focus on writing correct and idiomatic Python code, Fluent Python also covers and provides good general insights into concurrency, metaclasses, and writing good clean maintainable code. Highly recommended.
Profile Image for Wojtek Erbetowski.
57 reviews19 followers
March 7, 2018
Really good, but also very long. This book took me two months to complete, but it was worth it.
tThere was a surprising and uncommon thing, as I perceived it - the author tells you not only what and how, but also *why*, linking at the same time to discussions, PEPs and other sources from the history of Python. Highly recommended to current Python users.
Profile Image for Greg.
10 reviews
March 1, 2016
Quite a deep book on programming and programming concepts. I'm likely going to have to re-read several parts of this book again to completely understand what's going on, but this book is quite a good reading if you want to learn how to think about Python in a more meaningful way.
346 reviews
April 25, 2016
This is not only the best Python book that I have read, it is my favourite computer science book. The Author has done a fantastic job of explaining key concepts and gives additional information by linking to blogs/talks etc. Bravo Luciano
Profile Image for Andrew.
147 reviews7 followers
August 3, 2016
Not the book for me. Short on conceptual foundations, but long on poorly contextualized details. I recommend reading the chapter summaries and soap box sections and skipping the rest, except as a sort of tutorial when and if you come to need the technique.
Profile Image for Marco Bizzarri.
39 reviews4 followers
August 12, 2019
Excellent book to move from knowing the basics to mastering Python. Lots of useful references, the only minor point being the chapter on the co-routines not being up-to-date anymore.
Profile Image for Bart Kleijngeld.
62 reviews2 followers
January 17, 2022
I really enjoyed this book from Luciano. It is structured very well, making it suitable for future reference as well, but thanks to the numerous examples with call-outs and great skill in explaining concepts, it was a good read from start to finish as well.

For absolute beginners this book is definitely too hard, but for those who have some experience, the book is bound to offer you something, and very likely to offer you a lot. Much which it teaches was familiar to me, but sometimes it doesn't hurt to repeat. Moreover, I'm not the expert Luciano is, so some stuff I knew quite well, I now know the absolute core fundamentals of.

There was also stuff I barely touched in Python though, or simply never heard of. Usually I mean small things (liked named slicing, and the `shelve` and `bisect` libraries), but some big topics are treated so in-depth that it taught me a lot (about class meta programming and the subtleties of concurrent programming in Python for example).

On the downside, the book does try to cover many, many topis, and despite the good structuring and explanations, sometimes it tends to have a tough time choosing between going in-depth all the way, or remaining at the surface. Also, in the final chapters I feel there were a lot more typo's and potentially some minor mistakes that have made the already difficult stuff in there slightly more challenging even. All in all, however, these are relatively minor criticisms. This book is really good.

Highlights from the book for me:

- Pt. 1, Ch. 1: The Python Data Model. This is the perfect example of how some of my pre-existing knowlegde has been grounded with stronger, more philosophical foundations. Great (re)read for pretty much any Python developer or beginner.
- Pt. III: Functions As Objects. I believe many users are too unfamiliar with functional programming ideas, and these chapters give a great introduction to how to use functions in practical and abstract ways.
- Pt. IV, Ch. 11: From Protocols to ABCs. A great chapter which covers Python's take on much of the OO philosophy. Great read to get a better grasp on how to think about your Python code.
- Pt. V: Control Flow. This entire part is very informative. I knew about generator expressions/functions, but the level of detail here to explain the exact differences between iterables and iterators, function/class approaches thereof, helped me grasp the concepts a lot more fundamentally. Furthermore there's three great chapters about concurrent programming that really gave me a great basis to build on. The difference between threads, callbacks and coroutines, and how coroutines are implemented as generator functions: wow.
- Ch. 20: Attribute Descriptors: This chapter explanis the descriptor protocol, and how properties and class methods are examples of them. Pretty abstract stuff, but recommended to have read at least.

YMVV, but these were the best chapters for me.

I thought the book was great, and I would highly recommend it to anyone who's serious about getting better at Python, and wants to cover a lot of ground.
Displaying 1 - 30 of 134 reviews

Can't find what you're looking for?

Get help and learn more about the design.