The Book: First Edition

What This Book Covered

Effective Python: First Edition Book Cover

You are reading about the previous, old version of this book. The second edition of this book (released in November, 2019) is focused exclusively on Python 3, up to and including version 3.8.

Most of the original items from the first edition have been revised and included in the second edition, but many have undergone substantial updates. For some items my advice has completely changed between the two 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 on January 1st, 2020, the first edition of the book (released in March, 2015) may be more useful to you.

Buy the First Edition Book

Also available in translations:

日本語, Deutsche, 简体中文, 繁体中文, Русский, Polszczyzna, 한국어, Português

History about the First Edition

Секреты Python

Wed 07 August 2019

Секреты Python

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.

Python Eficaz

Sat 06 August 2016

Python Eficaz

The publishing house Novatec Editora has translated and released a Portuguese version of Effective Python. You can buy the book directly from the publisher.

Effective Python 简体中文

Sat 07 May 2016

Effective Python 简体中文

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.

Effective Python 파이썬 코딩의 기술

Sun 03 April 2016

Effective Python 파이썬 코딩의 기술

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.

Effective Python 日本語

Sat 23 January 2016

Effective Python 日本語

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.

Efektywny Python

Fri 20 November 2015

Efektywny Python

The publishing house Helion has translated and released a Polish version of Effective Python. You can buy the book directly from the publisher.

Effektiv Python ​programmieren

Sun 15 November 2015

Effektiv Python programmieren

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).

Talk Python To Me Podcast

Wed 09 September 2015

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.

Effective Python 中文版

Thu 27 August 2015

Effective Python 中文版

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.

Live Lessons Video

Tue 04 August 2015

Effective Python Live Lessons

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.

Talk at PyCon Montréal

Fri 10 April 2015

I gave a talk at PyCon Montréal entitled “How to Be More Effective with Functions”. Continue reading »

Item 40: Consider Coroutines to Run Many Functions Concurrently

Tue 10 March 2015

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 »

The Book Is Published

Fri 06 March 2015

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 Now Available

Sun 15 February 2015

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.

Item 23: Accept Functions for Simple Interfaces Instead of Classes

Thu 12 February 2015

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 »

Item 34: Register Class Existence with Metaclasses

Mon 02 February 2015

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 »

Item 53: Use Virtual Environments for Isolated and Reproducible Dependencies

Wed 21 January 2015

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 »

Item 17: Be Defensive When Iterating Over Arguments

Sat 03 January 2015

When a function takes a list of objects as a parameter, it’s often important to iterate over that list multiple times. Continue reading »

The Rough Cut Is Online

Thu 18 December 2014

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.

Now Available for Preorder

Thu 04 December 2014

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.

Final Draft Done

Sun 16 November 2014

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.

Welcome

Mon 18 August 2014

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.