Jump to ratings and reviews
Rate this book

How to Make Mistakes in Python

Rate this book
Even the best programmers make mistakes, and experienced programmer Mike Pirnat has made his share during 15+ years with Python. Some have been simple and silly; others were embarrassing and downright costly. In this O’Reilly report, he dissects some of his most memorable blunders, peeling them back layer-by-layer to reveal just what went wrong.

154 pages, ebook

First published January 1, 2015

4 people are currently reading
66 people want to read

About the author

Mike Pirnat

1 book4 followers
Mike Pirnat counterpoints the surrealism of the underlying metaphor.

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
9 (10%)
4 stars
36 (41%)
3 stars
26 (30%)
2 stars
13 (15%)
1 star
2 (2%)
Displaying 1 - 20 of 20 reviews
Profile Image for Petr Kopač.
14 reviews
January 25, 2016
It's fun to read and there are some good notions of how not to write in python (or well, any language).
Profile Image for Steve Clark.
87 reviews1 follower
December 10, 2015
A short read, but some good general types on avoiding issues with Python programming
Profile Image for Martin.
Author 1 book6 followers
June 14, 2017
I like this book a lot. As Python beginner (but Java experienced) I learned a lot of mistakes I will definitely meet. From coding style to structures, methods, finding errors. Every pitfall has a recomendation how to avoid it. I like the friendly style of this book.


Stare deeply into a line of code like SBD=J(D(H),SB) and it’s like gazing into the abyss.


If people on your team really like to import * and you’re having a hard time convincing them that it’s a bad idea, just slip this little gem into a module that they import everything from: False, True = True, False Yes, Python will let you reverse the meanings of True and False. Please use this knowledge with kindness… unless they really deserve it.
Profile Image for Illia.
210 reviews4 followers
October 29, 2016
Ну таке. Скоріш тягне на пост для блога, може на два, ніж на цілу книгу.
5 reviews
October 28, 2018
Good position for beginner , you'll get some precious tips about what you should avoid in Python. Book is written in a friendly manner so it won't take you too much time to read it. You can easily add it to your to do list without sacrificing too much time.
Profile Image for Vlad Bezden.
236 reviews14 followers
June 27, 2017
Whole book is about Python best practices and tips.
Profile Image for Patrick.
33 reviews2 followers
July 24, 2017
This book did nothing to help my snake breeding side business. However, my programming work now is much cleaner.
Profile Image for Aric.
47 reviews4 followers
June 29, 2019
Some sage advice wrapped up in a small time investment. I strongly recommend this one.
139 reviews1 follower
June 24, 2023
I think the title is just amazing.

It's basically just a book that lists out a bunch of pitfalls and common antipatterns along with some better alternatives.

Refreshingly honesty. Very useful.
Profile Image for Jason McDonald.
Author 2 books1 follower
November 7, 2018
A brief, hilarious whirlwind tour of the author's own personal dumbest coding mistakes. A must read for every Python developer.
Profile Image for Philipp.
688 reviews222 followers
April 11, 2016
Thanks to Sebastian Raschka's review I found out about this (link), a short book detailing some of the things that can go wrong in the life of a regular Python programmer according to the book's author. It starts with "these are the things that you should do (use Ipython/Jupyter, use virtualenv etc.) and then goes to all the things that went wrong in the author's lifeexperience with Python - forgetting to return values at the end of functions, weird monkeypatching that always goes wrong in a weird hard-to-debug spot at the worst time possible, not testing, too broad exception catching etc.

(Side-note: This is one of the reasons why I like Go - the Go compiler doesn't compile your code when something's off, about 25-40% of the problems in this book are impossible. You'll just have to deal with other problems...)

It's a very short read, you can read it in an afternoon. Of course it's subjective - a lot of my work with Python involves parsing files so I run into other problems, like assuming that the string numbers in the file somehow magically become floats, then doing maths with them, and 3*"123" becomes "123123123" instead of 369, or accidentally checking whether "1" > 9 (this is True in Python 2).

Recommended for: new Python programmers who've just finished their introductory course and want some "old-timer experience"; advanced Python programmers seeking to hone their craft, expert Python programmers who like to nod and stroke their big, white, bushy beard while saying "ah yes, I remember" while staring into the distance.
Profile Image for Julio Biason.
199 reviews28 followers
January 2, 2017
For anyone that works with Python for some time, most of the content of this book is "Hahaha, yeah, I did that too. The good old bad times." And, surely enough, you can't hold yourself nodding when the author mentions that you shouldn't do that.

I felt it lacked a bit of "this is the right way of doing it", like Uncle Bob did with Clean Code: A Handbook of Agile Software Craftsmanship, where he picks a code and starts refactoring till it gets "correct". Most of the time, it's a bunch of code (sometimes, invalid code, but that's minor) and then a simple "don't do that".
Profile Image for Aleksandar.
84 reviews
November 4, 2016
An entertaining, and humbling look into mistakes, and anti-patterns that we all make. Pirnat goes over how to avoid such mistakes, why, and more importantly, and something everyone else seems to ignore, why we make those mistakes in the first place, and why they feel so good.

Recommend it to any Python developer for its humbleness, and accessibility.
Profile Image for Gábor Hajba.
139 reviews3 followers
November 25, 2016
Everyone makes mistakes. One learn from their own, others from mistakes done by others. This book is great if you want to see what mistakes a seasoned developer can make and made already.

This book is a reflection on past mistakes which happen to everyone so better be careful with your code: use this as some guide along the road.
Profile Image for Alex Fürstenau.
190 reviews14 followers
April 1, 2016
It's a nice and short book. He communicates, like everybody should, via stories. His stories are illustrated via real code examples. All this together makes a fine combination although I don't agree with everything he is saying.
Profile Image for Vishell.
13 reviews2 followers
November 4, 2016
2 start is not that bad, Goodread says: "it was ok". So another book that is useless for advanced python programmers. But if you are beginning to explore, i recommend you read it. `False, True = True, False` is quite a thing!
Profile Image for Emad Mokhtar.
40 reviews20 followers
April 14, 2016
It is a light weight book about developer's lesson learned during Python development career, nice and informative.
42 reviews3 followers
May 10, 2016
The author talk about his beginner mistakes, when he start programming in python. And teach you how to not repeat his stupid mistakes, by given you some tips from his experience.
Displaying 1 - 20 of 20 reviews

Can't find what you're looking for?

Get help and learn more about the design.