Buy new:
$54.44$54.44
Arrives:
Wednesday, May 17
Ships from: Amazon.com Sold by: Amazon.com
Buy used: $32.00
Other Sellers on Amazon
+ $22.69 shipping
94% positive over last 12 months
Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required. Learn more
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Fluent Python: Clear, Concise, and Effective Programming 1st Edition
There is a newer edition of this item:
Purchase options and add-ons
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 covers:
- Python data model: understand how special methods are the key to the consistent behavior of objects
- Data structures: take full advantage of built-in types, and understand the text vs bytes duality in the Unicode age
- Functions as objects: view Python functions as first-class objects, and understand how this affects popular design patterns
- Object-oriented idioms: build classes by learning about references, mutability, interfaces, operator overloading, and multiple inheritance
- Control flow: leverage context managers, generators, coroutines, and concurrency with the concurrent.futures and asyncio packages
- Metaprogramming: understand how properties, attribute descriptors, class decorators, and metaclasses work
- ISBN-101491946008
- ISBN-13978-1491946008
- Edition1st
- PublisherO'Reilly Media
- Publication dateSeptember 15, 2015
- LanguageEnglish
- Dimensions7 x 1.57 x 9.19 inches
- Print length790 pages
1 or more items shipped or sold by sellers other than Amazon.com
Frequently bought together

- +
- +
Products related to this item
From the brand
-
-
Sharing the knowledge of experts
O'Reilly's mission is to change the world by sharing the knowledge of innovators. For over 40 years, we've inspired companies and individuals to do new things (and do them better) by providing the skills and understanding that are necessary for success.
Our customers are hungry to build the innovations that propel the world forward. And we help them do just that.
From the Publisher
From The Preface
An experienced programmer may start writing useful Python code in a matter of hours. As the first productive hours become weeks and months, a lot of developers go on writing Python code with a very strong accent carried from languages learned before. Even if Python is your first language, often in academia and in introductory books it is presented while carefully avoiding language-specific features.
As a teacher introducing Python to programmers experienced in other languages, I see another problem that this book tries to address: we only miss stuff we know about. Coming from another language, anyone may guess that Python supports regular expressions, and look that up in the docs. But if you’ve never seen tuple unpacking or descriptors before, you will probably not search for them, and may end up not using those features just because they are specific to Python.
This book is not an A-to-Z exhaustive reference of Python. Its emphasis is on the language features that are either unique to Python or not found in many other popular languages. This is also mostly a book about the core language and some of its libraries. I will rarely talk about packages that are not in the standard library, even though the Python package index now lists more than 60,000 libraries and many of them are incredibly useful.
Who This Book Is For
This book was written for practicing Python programmers who want to become proficient in Python 3. If you know Python 2 but are willing to migrate to Python 3.4 or later, you should be fine. At the time of this writing, the majority of professional Python programmers are using Python 2, so I took special care to highlight Python 3 features that may be new to that audience.
However, Fluent Python is about making the most of Python 3.4, and I do not spell out the fixes needed to make the code work in earlier versions. Most examples should run in Python 2.7 with little or no changes, but in some cases, backporting would require significant rewriting.
Having said that, I believe this book may be useful even if you must stick with Python 2.7, because the core concepts are still the same. Python 3 is not a new language, and most differences can be learned in an afternoon. What’s New in Python 3.0 is a good starting point. Of course, there have been changes since Python 3.0 was released in 2009, but none as important as those in 3.0.
If you are not sure whether you know enough Python to follow along, review the topics of the official Python Tutorial. Topics covered in the tutorial will not be explained here, except for some features that are new in Python 3.
Who This Book Is Not For
If you are just learning Python, this book is going to be hard to follow. Not only that, if you read it too early in your Python journey, it may give you the impression that every Python script should leverage special methods and metaprogramming tricks. Premature abstraction is as bad as premature optimization.
Editorial Reviews
From the Author
This book was written for practicing Python programmers who want to become proficient in Python 3. If you know Python 2 but are willing to migrate to Python 3.4 or later, you should be fine. [...]
If you are not sure whether you know enough Python to follow along, review the topics of the official Python Tutorial. Topics covered in the tutorial will not be explained here, except for some features that are new in Python 3.
Who This Book Is Not For
If you are just learning Python, this book is going to be hard to follow. Not only that, if you read it too early in your Python journey, it may give you the impression that every Python script should leverage special methods and metaprogramming tricks. Premature abstraction is as bad as premature optimization.
(extracted from the Preface, page xvi, emphasis added)
About the Author
Luciano Ramalho was a Web developer before the Netscape IPO in 1995, and switched from Perl to Java to Python in 1998. Since then he worked on some of the largest news portals in Brazil using Python, and taught Python web development in the Brazilian media, banking and government sectors. His speaking credentials include PyCon US (2013), OSCON (2002, 2013), and 15 talks over the years at PythonBrasil (the Brazilian PyCon) and FISL (the largest FLOSS conference in the Southern Hemisphere). Ramalho is a member of the Python Software Foundation and co-founder of Garoa Hacker Clube, the first hackerspace in Brazil. He is co-owner of Python.pro.br, atraining company.
Product details
- Publisher : O'Reilly Media; 1st edition (September 15, 2015)
- Language : English
- Paperback : 790 pages
- ISBN-10 : 1491946008
- ISBN-13 : 978-1491946008
- Item Weight : 3.03 pounds
- Dimensions : 7 x 1.57 x 9.19 inches
- Best Sellers Rank: #288,316 in Books (See Top 100 in Books)
- #175 in Object-Oriented Design
- #340 in Python Programming
- #485 in Software Development (Books)
- Customer Reviews:
About the author

Luciano Ramalho was a Web developer before the Netscape IPO in 1995, and switched from Perl to Python in 1998. He has presented talks at PyCon US, OSCON, QCon, PythonBrasil, PyCon DE etc. Ramalho is a fellow of the Python Software Foundation and co-founder of Garoa Hacker Clube, the first hackerspace in Brazil. He is a Principal Consultant at Thoughtworks.
Related products with free delivery on eligible orders Sponsored Hide feedback | Try Prime for unlimited fast, free shipping
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on AmazonReviewed in the United States on September 13, 2019
-
Top reviews
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
I read this book in chapter chunks, as there is a TON of information to gain from this book. I love the structure that Ramalho uses. He provides well written descriptions and explanations for each topic(something I cannot say for most textbooks). On top of that, he provides relevant code examples for almost everything he covers. Even better, he has step-by-step explanations for the code examples that follow the execution flow. This makes it much easier to understand if you have difficulty grasping the concept at first. Aside from coding the examples yourself, this is top notch for learning skills from text.
For me, I was reading this book while working on a medium sized Python project. Even though I was not searching for anything specific in this book, the more I read, the more I found ways where I could implement his teachings into my project.
Ramalho includes a section at the end of each chapter to offer his opinion on said topic. As a younger programmer, I appreciated the opinion from a professional and clearly well respected member of the Python community.
If you write Python and want to gain a better understanding of the language (and perhaps found the Python docs hard to read like me), this book is for you. If you do give it a read, I hope you like it as much as I did.
Thanks Luciano, excellent work!
This book is exactly what I was looking for. It covers the aspects of Python that are not obvious to people coming from different languages. It gives guidance on the best ways to use features and why they work the way they do. It touches on details of Python internals where they illuminate the behavior and choices a Python programmer might make but you won't get bogged down in Python byte code.
This is not a book for beginners. It assumes a fair bit of knowledge. A beginner will want a wider coverage of topics and not get buried in details. (I really like "Learning Python" by Mark Luft and still go back to that from time to time.) This is for the Python programmer leveling-up. That is where I found myself and I am pretty confident this will help me get there.
For the last year, I have been trying to jump to the next level in my understanding of Python. I had been writing competent python code off and on for several years. I had a feeling of what the next level must be like, but I just could not grasp its full meaning. Fluent Python brought it all into focus. The perfect book at just the right time in my development as a python programmer. With each page, I gained a new insight into how to make my code more effective. At every juncture, I knew how I could apply what I had just read in my own programming. It was actually quite thrilling.
Contrary to popular advice, I don't read sitting at the keyboard. But I often have to get out of my La-z-boy to go and try some confusing piece of sample code. Or the text is so poorly written, I have to backup and reread a section several times. Often, it becomes a chore to push through the last few pages of a chapter. But reading Fluent Python was exciting, I could put it down and finished the first ten chapters (~300 page) in one sitting.
Otherwise quite good
Top reviews from other countries
The first example in the book looks to build a deck of cards using Python. If you've had a lot of experience using Python then it may seem fairly straightforward, or if you're more like me then you'll probably start thinking that this book might be for a more advanced python programmer. The good news is that each aspect of the first example is broken down into it's individual components and discussed in great detail - in fact, most of the early chapters could be used to help build on the first example so everything feels practical.
One of the great strengths of this book is how the Author is able to communicate concepts in Python to programmers with little experience (which I consider myself to be). I have seen countless answers on stack overflow with 100's of up votes but I've never been able to understand the answer in any shape or form. I was pleased to find that I never really felt this while learning from this book. Of course, there were lots of times where it took me longer to truly understand a new concept but that's to be expected. Personally, I benefited massively from using this book because there is a lot use of OOP and dunder methods which is what I had really hoped for.
I don't think I can be too critical of the book, there were a few chapters which I haven't read but that was my choice, for now at least. It gets a bit heavy in the last 4 or 5 chapters but it's not something I think I need to know right now and I can always come back to these at a later date.
If you're starting out with Python then I think this book is a must-have. I was very pleased that I made the decision to buy this book, if you're committed to learning Python then you'll always be thankful to have this book on hand as it may just help clear up something you didn't understand. I would also advise buying the Kindle version of the book as I've had the command prompt open whilst reading the book as I was coding some of the examples myself to see if I got the same outcomes as in the book - I think I'd have been worse off if I bought an actual copy of the book because you can't just learn python, you have to actually do it as well so the kindle version helped me to do this.
1) It is long-winded: the material could have been covered adequately in half the number of pages.
2) The code samples are artificial and boring. They may illustrate the point but it doesn't aid memorization.
3) The code samples have no comments in them: the explanatory comments are in the text that follows. This is very irritating, time-wasting and slows down comprehension, having to jump back and forth between the code and the comments. A terrible layout choice. And writing code without inline comments is just unprofessional. Moreover, why not not use colour in the code samples: every modern editor understands language syntax and highlights different terms in different colours. If the comments were inline and colour were used then it would be very easy to read. Sure, one can open the code samples in one's favourite editor and see them in colour that way, but that shouldn't be necessary. 'Python Cookbook', also from O'Reilly and published a couple of years earlier, does use colour.
4) The publisher could have used at least one reviewer not intimately familiar with the material covered, rather than just using Python language freaks. Such a person might have pointed out where information is lacking or where the book is didactically inadequate.
For example, you might expect Chapter 16, Coroutines, to start with a definition of what a coroutine is, to set the context and motivation for what follows. But no, instead you get:
"We find two main senses for the verb “to yield” in dictionaries: to produce or to give way. Both senses apply in Python when we use the yield keyword in a generator. A line such as yield item produces a value that is received by the caller of next(...), and it also gives way, suspending the execution of the generator so that the caller may proceed until it’s ready to consume another value by invoking next() again. The caller pulls values from the generator."
That just makes ones eyes glaze over. Contrast this waffle with the first paragraph of the Wikipedia article on coroutines:
"Coroutines are computer program components that generalize subroutines for non-preemptive multitasking, by allowing execution to be suspended and resumed. Coroutines are well-suited for implementing familiar program components such as cooperative tasks, exceptions, event loops, iterators, infinite lists and pipes. "
which is succinct and to the point.
In fact, there is a lot of launching into topics in the book without an adequate introduction.
5) I often found myself Googling/DuckDuckGoing to find a better explanation of some point than that available in the book.
6) There are a lot of comparisons in the book between Python and other languages. This was just verbiage to skim through that wasted my time.





