Juha-Matti Santala
Community Builder. Dreamer. Adventurer.

Book recommendation: Fluent Python (2nd Edition)

Batteries included is a blog series about the Python Standard Library. Each day, I share insights, ideas and examples for different parts of the library. Blaugust is an annual blogging festival in August where the goal is to write a blog post every day of the month.

Fluent Python (2nd Edition) by Luciano Ramalho is maybe the best Python book I’ve ever read. It’s not a beginner book but aimed for people who already have experience in Python and want to improve their Python programming and get the best out of the standard library and language constructs.

In the book’s almost 1000 pages, it covers all sorts of aspects of the languag.e In general, it covers these topics really wide and to me on necessary level but it doesn’t do a lot of deep dives. The way to book is structured makes it easy to jump around and find the topics you’re interested in.

The book starts with the basic topics like Python’s data model, lists, dicts, sets and so on but provides good insights into those on an intermediate to advanced level so I recommend not skipping them as “too basic” even for experienced developers.

In the second part, it discusses functions as objects: higher-order functions, type hints, decorates, closures and so on.

Third part focuses on objects and how to create and use them in a pythonic way. Most of the topics there I knew but it gave me many moments of “A-ha!” as I realised how to really build the objects in a way that utilises how Python is built in the best possible way.

Fourth part covers control flow: iterators, generators, coroutines, context managers, pattern matching and many others. It dedicates couple of chapters to concurrency and asynchronous programming.

Fifth part of the book is about metaprogramming in Python. It covers dynamic attributes and properties, attribute descriptors and class metaprogramming. This is the part that I’m least familiar with in general and while the book kept the style very readable and easy to approach, I’ll need to let the ideas to marinate more and return to the last part a few more times in the future.

Reading through this book definitely helped me take my Python programming to a new level and I’m really happy I decided to get this book. I highly recommend getting this book if you feel you’re comfortable with Python but want to learn more and write better Python code.

This book review brings us to the end of Batteries included. Tomorrow is the last day of August and I’ll be wrapping up this month and this experience and what I’ve learned from it. Thank you for joining this journey with me as a reader!