You are reading about a previous, old version of this book. The third edition of this book (released in November, 2024) is focused exclusively on Python 3, up to and including version 3.13.
Many of the original items from the first edition have been revised and included in the second and third editions, but they have undergone substantial updates. For some items my advice has completely changed between the three editions of the book due best practices evolving as Python has matured.
If, for whatever reason, you’re still primarily using Python 2, despite its end-of-life in April 2020, the first edition of the book (released in March, 2015) may be more useful to you.
Translations are available in 日本語, Deutsche, 简体中文, 繁体中文, Русский, Polszczyzna, 한국어, Português
The publishing house Вильямс has translated and released a Russian version of Effective Python. You can buy the book online from Ozon and learn more on the publisher website.
The publishing house Novatec Editora has translated and released a Portuguese version of Effective Python. You can buy the book directly from the publisher.
The publishing house 机械工业出版社 (China Machine Press) has translated and released a Chinese (Simplified) version of Effective Python. You can buy the book directly from the publisher or get it on Amazon.cn.
The publishing house Gilbut Inc. has translated and released a Korean version of Effective Python. The publisher’s website links to many different retailers online where you can buy the book.
The publishing house O’Reilly Japan has translated and released a Japanese version of Effective Python. You can buy the book directly from the publisher or get it on Amazon.jp.
The publishing house Helion has translated and released a Polish version of Effective Python. You can buy the book directly from the publisher.
The publishing house mitp-Verlag has translated and released a German version of Effective Python. You can buy the book directly from the publisher or get it on Amazon.de (including Kindle edition).
I was invited on to the Talk Python To Me Podcast to talk about Effective Python. You can read the full transcript here or listen to the audio embedded below. Thanks to Michael Kennedy for being such a welcoming host.
The publishing house 碁峰 (Acer Peak) has translated and released a Chinese (Traditional) version of Effective Python. You can buy the book directly from the publisher or get a digital edition on Google Play.
I worked with Addison-Wesley to produce a video version of the book Effective Python. You can view samples and buy the video on the publisher’s website.
It includes 5 hours of video, covering 32 items from the book in six lessons. The content is primarily me using a source code editor to write Python programs that demonstrate the items from the book.
I gave a talk at PyCon Montréal entitled “How to Be More Effective with Functions”. Continue reading »
Threads give Python programmers a way to run multiple functions seemingly at the same time. But there are three big problems with threads: Continue reading »
Printed, physical copies of the Effective Python book are now for sale! Follow this link to buy directly from the publisher (free shipping in the USA). The publisher also has ePub and PDF versions available. Follow this link to buy from Amazon. Amazon also has a Kindle edition available.
Digital editions of Effective Python are now available. Follow this link to buy the ePub or PDF version. Follow this link to buy the Kindle edition. The print copy is due out on March 6th.
Many of Python’s built-in APIs allow you to customize behavior by passing in a function. These hooks are used by APIs to call back your code while they execute. Continue reading »
A common use of metaclasses is to automatically register types in your program. Registration is useful for doing reverse lookups, where you need to map a simple identifier back to a corresponding class. Continue reading »
Building larger and more complex programs often leads you to rely on various packages from the Python community. You’ll find yourself running pip
to install packages like pytz
, numpy
, and many others.
The problem is that by default pip
installs new packages in a global location. That causes all Python programs on your system to be affected by these installed modules. In theory, this shouldn’t be an issue. If you install a package and never import
it, how could it affect your programs?
Continue reading »
When a function takes a list of objects as a parameter, it’s often important to iterate over that list multiple times. Continue reading »
Can’t wait until next year for the book to be published? The rough cut is now available on Safari Books Online. This is an early preview of the full content of the book before editing has been completed.
Effective Python is now available for preorder on Amazon. Follow this link to buy your copy in advance. It will ship in early 2015 once the book is published.
The final draft of the book is done. It’s 55,000 words, 250+ pages, 8 chapters, 59 items. Reviewers spent a lot of time looking over earlier drafts to ensure that the book will be useful. Now it’s off to production to be turned into a printable layout.
This website is now live! Here you’ll find updates about my progress towards Effective Python‘s eventual publishing by Addison-Wesley. You can find other books from the Effective series in Pearson’s online store.