Before fixing a client’s Python, find the except that hides errors
The third edition of Brett Slatkin’s Effective Python, updated to Python 3.13, works best as a checklist for inherited code rather than a cover-to-cover read.

In brief
- The third edition, published on November 20, 2024, has 125 items, 35 of them new, and adds chapters on Robustness and Performance.
- FDEs should read Robustness and Functions first, then Testing and Collaboration, and leave Performance until after those.
- The three principles most worth keeping: don’t let errors disappear, change code gradually once tests are in place, and measure before optimizing.
A client’s data pipeline occasionally writes empty rows, and nobody knows why. In this hypothetical first week on site, you open the code and find a function that wraps an API call in except Exception: and returns None when something fails. No log records what happened.
Both habits have their own items in Effective Python: 125 Specific Ways to Write Better Python, third edition, by Brett Slatkin. Addison-Wesley Professional published the book on November 20, 2024 (ISBN-13 978-0-13-817218-3). The publisher describes Slatkin as having many years of experience at Google.
For an FDE, the book is most useful as a checklist of what to inspect when taking over someone else’s code, and how to fix it without breaking a running system.
What is new in the third edition?
The third edition grows from 90 items to 125, of which 35 are entirely new. It covers Python versions up to 3.13, so subjects such as match and dataclasses are treated in modern syntax.
The strongest reason to buy it is the pair of new chapters on Robustness and Performance. The book also goes deep on C extensions and calling native libraries, for performance problems that pure Python cannot solve.
The author maintains an official code repository on GitHub, bslatkin/effectivepython, in which each item has its own example file or directory. That makes the book easy to use as a reference: when you hit a bug, open the relevant item and run its example.
What order should you read it in?
Don’t read it from the first page to the last. When preparing to change a client’s code, start with the Robustness chapter, which covers the full use of try/except/else/finally, why not to catch the whole Exception class, and exception chaining.
Those are the three things needed to repair the pipeline that writes empty rows. Next comes the Functions chapter: Item 32 advises raising exceptions instead of returning None, and Item 30 warns that arguments passed to a function can be mutated. Both are common sources of bugs in unfamiliar code.
Then read Testing and Collaboration, and only after that Performance and Concurrency. The order has a reason: before making code faster, you need to be sure you can change it without breaking something else.
Lesson one: don’t let errors disappear
Go back to the function that calls the API. With except Exception: return None, an authentication failure, a timeout and a typo in the code all look identical: each one is None. The illustrative code below sets the old version beside one revised in the spirit of the Robustness chapter and Item 32.
# Before: every error becomes None
def fetch_orders(client, day):
try:
return client.get_orders(day)
except Exception:
return None
# After: catch only the errors you understand and keep the exception chain
class OrderFetchError(Exception):
pass
def fetch_orders(client, day):
try:
return client.get_orders(day)
except TimeoutError as e:
raise OrderFetchError(f"Timeout fetching orders for {day}") from e
In the second version, a timeout becomes a clearly named error, and from e preserves the root cause. Every other error, typos included, surfaces instead of being swallowed. The next time an empty row would have appeared, a stack trace will point straight to the cause.
Make this your first task at a client: find every place that catches Exception and every function that returns None to signal an error. The list tells you what the system is hiding.
Lesson two: get tests in place, then change code gradually
Item 109 advises preferring integration tests to unit tests. For code with no tests, this is practical advice: a test that runs the whole flow from input to output preserves current behavior even before you understand each function inside it.
Item 112 covers encapsulating dependencies to make mocking easier, which helps when that flow calls the client’s database or API.
The Collaboration chapter adds two tools for gradual change. Item 123 uses warnings to tell callers that a function’s usage is about to change, giving the client’s team time to migrate. Item 124 uses typing for static analysis, catching errors before the code runs.
Together, they let you refactor step by step without breaking what is already running.
Lesson three: measure first, optimize second
The Performance chapter opens with Item 92, “Profile Before Optimizing.” Item 93 shows how to microbenchmark with timeit, and Item 94 discusses when to replace Python with another language. The sequence amounts to a process: find the real slow spot, measure before and after the change, and consider C extensions only once the options within Python are exhausted.
Concurrency calls for the same caution. Item 68 advises using threads for blocking I/O and not for parallelizing computation. If a client wants to speed up a heavy data-processing job by adding threads, read this item before agreeing.
Who should read it, and how can it help your career?
The book pays off most for developers who have written Python for a few years, mainly on their own code. Anyone preparing to move into an FDE role should read it too, because the job almost always starts with reading other people’s code.
On your résumé, don’t write “proficient in Python.” Describe a specific piece of work, such as replacing overly broad Exception handlers with typed exceptions, adding integration tests to an untested flow, then profiling to find the real bottleneck.
In an interview, if you are handed an unfamiliar piece of code, ask how it is measured before proposing optimizations. The question shows the interviewer that you have worked on real systems.
All 125 items are useful, but the ten or so mentioned here are enough to change how you work in your first week at a client.
Was this article useful?
Thanks for the feedback!