Master the art of Python programming with 125 actionable best practices to write more efficient, readable, and maintainable code.
Python is a versatile and powerful language, but leveraging its full potential requires more than just knowing the syntax. Effective 125 Specific Ways to Write Better Python, 3rd Edition is your comprehensive guide to mastering Python's unique strengths and avoiding its hidden pitfalls. This updated edition builds on the acclaimed second edition, expanding from 90 to 125 best practices that are essential for writing high-quality Python code.
Drawing on years of experience at Google, Brett Slatkin offers clear, concise, and practical advice for both new and experienced Python developers. Each item in the book provides insight into the "Pythonic" way of programming, helping you understand how to write code that is not only effective but also elegant and maintainable. Whether you're building web applications, analyzing data, writing automation scripts, or training AI models, this book will equip you with the skills to make a significant impact using Python.
Key Features of the 3rd
Expanded Now with 125 actionable guidelines, including 35 entirely new items. Updated Best Reflects the latest features in Python releases up to version 3.13. New Additional chapters on how to build robust programs that achieve high performance. Advanced In-depth coverage of creating C-extension modules and interfacing with native shared libraries. Practical Realistic code examples that illustrate each best practice.
I don’t know how much I’ll be reading this year, so I figured I should just log this book even though it’s really something that doesn’t really belong on GoodReads. I’m also typing this review in the middle of the Taiwanese countryside and I have nothing else to do.
The book started out with some pretty basic tidbits and facts, so I didn’t think it was necessary to take notes. However, about a third of the way in, I realized that there were actually some interesting items that were worth recording. There’s lots of details on generators, metaclasses, concurrency, async, and C libraries that cover concepts that I didn’t have any exposure to before. Even if I did know some of the concepts before, this book would often provide context for certain decisions or best practice behaviors rooted in historical changes in Python.
It does feel sometimes that it might be better centered around lessons, than strictly factual tidbits. For instance, in the classes section it discusses mix-in classes as more Pythonic than using multiple inheritance, but then forgoes mentioning composition at all, even though the latter is likely the most Pythonic. It made me realize there may be other “more Pythonic” concepts this might not be fully covered in this book, so it’s definitely a supplementary reading material rather than an all-inclusive textbook. Also, it’s probably not the most beginner friendly textbook.
Overall I’d recommend this to any Python developer as a supplementary reading material - definitely lots of interesting concepts contained in it.
Final Review: 4.25/5. A solid read and reference book I’d keep around, but structuring it as “125 things to know” might leave out certain concepts that might be worth even a brief mention.
A nice update to a classic of Python programming. This time I bought the Kindle edition, and for the most part it didn't disappoint. I found the code snippets section at the end to be worthless. Way better to copy/paste the code from the official repo (https://github.com/bslatkin/effective...). I strongly recommend the paperback edition if you have shelf space. Also, don't expect any mention of AI tools, surely the next edition will have one!