Buy new:
$29.99$29.99
Arrives:
Wednesday, May 17
Ships from: Amazon.com Sold by: Amazon.com
Buy used: $23.46
Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required. Learn more
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Python Tricks: A Buffet of Awesome Python Features Paperback – October 25, 2017
| Price | New from | Used from |
- Kindle
$8.99 Read with Our Free App - Paperback
$29.9910 Used from $12.65 16 New from $20.18
Explore your book, then jump right back to where you left off with Page Flip.
View high quality images that let you zoom in to take a closer look.
Enjoy features only possible in digital – start reading right away, carry your library with you, adjust the font, create shareable notes and highlights, and more.
Discover additional details about the events, people, and places in your book, with Wikipedia integration.
Purchase options and add-ons
“I don’t even feel like I’ve scratched the surface of what I can do with Python”
With Python Tricks: The Book you’ll discover Python’s best practices and the power of beautiful & Pythonic code with simple examples and a step-by-step narrative.
You'll get one step closer to mastering Python, so you can write beautiful and idiomatic code that comes to you naturally.
Learning the ins and outs of Python is difficult—and with this book you'll be able to focus on the practical skills that really matter. Discover the “hidden gold” in Python’s standard library and start writing clean and Pythonic code today.
Who Should Read This Book:
- If you’re wondering which lesser known parts in Python you should know about, you’ll get a roadmap with this book. Discover cool (yet practical!) Python tricks and blow your coworkers’ minds in your next code review.
- If you’ve got experience with legacy versions of Python, the book will get you up to speed with modern patterns and features introduced in Python 3 and backported to Python 2.
- If you’ve worked with other programming languages and you want to get up to speed with Python, you’ll pick up the idioms and practical tips you need to become a confident and effective Pythonista.
- If you want to make Python your own and learn how to write clean and Pythonic code, you’ll discover best practices and little-known tricks to round out your knowledge.
What Python Developers Say About The Book:
"I kept thinking that I wished I had access to a book like this when I started learning Python many years ago." — Mariatta Wijaya, Python Core Developer
"This book makes you write better Python code!" — Bob Belderbos, Software Developer at Oracle
"Far from being just a shallow collection of snippets, this book will leave the attentive reader with a deeper understanding of the inner workings of Python as well as an appreciation for its beauty." — Ben Felder, Pythonista
"It's like having a seasoned tutor explaining, well, tricks!" — Daniel Meyer, Sr. Desktop Administrator at Tesla Inc.
- Print length301 pages
- LanguageEnglish
- Publication dateOctober 25, 2017
- Dimensions6 x 0.68 x 9 inches
- ISBN-101775093301
- ISBN-13978-1775093305
Frequently bought together

- +
- +
4 stars and above
Editorial Reviews
About the Author
Product details
- Publisher : Dan Bader; 1st edition (October 25, 2017)
- Language : English
- Paperback : 301 pages
- ISBN-10 : 1775093301
- ISBN-13 : 978-1775093305
- Item Weight : 14.3 ounces
- Dimensions : 6 x 0.68 x 9 inches
- Best Sellers Rank: #48,468 in Books (See Top 100 in Books)
- #56 in Python Programming
- Customer Reviews:
About the author

Hey there! My name is Dan Bader and I’m a complete Python nut.
I’ve been obsessed with programming ever since I managed to convince my parents to buy me a dusty old Commodore 64 from the classifieds in a local newspaper. And my love for writing code hasn’t diminished since then.
Today I help Python developers take their coding skills and productivity to the next level. I’m an independent software engineer, author, and speaker. I’ve been developing software for 15 years—and I’d love to help you become a more proficient Python coder.
Products related to this item
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on AmazonReviewed in the United States on November 14, 2017
-
Top reviews
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
Dan truly wants to help you become more proficient with Python. Several times throughout the book, he uses phrases such as "Think of it this way …" or "Another way to look at this is …". At the end of each chapter, he summarizes the "Key Takeaways".
Dan recommends "Best Practices". He mentions specific ways of doing things that (although not required) are the way that the Python community expects them to be done.
I'm sure I'll be referring back to this book as I progress as a Python programmer.
As he notes in the Introduction, this book grew out of the Python Tricks emails, and it really shows. Dan has a knack for constructing code snippets that illustrate Python concepts in very few lines, and also for writing extremely clear descriptions of why they behave as they do. Further, even though Dan has years of Python experience, it seems clear to me he hasn't lost the sense of the ways in which Python can be confusing to new learners. I've only sampled here and there from his Buffet at this point, but have already gained two new concrete pieces of knowledge: bytearrays are mutable whereas bytes are not; and all it takes to create an abstract base class is to use metaclass=ABCMeta and decorate as needed with @abstractmethod. Even though I'd looked at the Python documentation for both of these before, I never quite understood either of them. But, Dan's phrasing and presentation made them crystal clear on my first read.
One additional thing I like about the book is how Dan has included bits and pieces of his philosophy on Python, programming, writing good code, etc. Some people might be turned off by the editorializing, I suppose, but I really appreciate that the book provides these sorts of "meta" perspectives.
All in all, an excellent resource for someone with modest to moderate Python experience looking to round out their knowledge of some of the more subtle features/behaviors of the language.
Reviewed in the United States 🇺🇸 on November 14, 2017
As he notes in the Introduction, this book grew out of the Python Tricks emails, and it really shows. Dan has a knack for constructing code snippets that illustrate Python concepts in very few lines, and also for writing extremely clear descriptions of why they behave as they do. Further, even though Dan has years of Python experience, it seems clear to me he hasn't lost the sense of the ways in which Python can be confusing to new learners. I've only sampled here and there from his Buffet at this point, but have already gained two new concrete pieces of knowledge: bytearrays are mutable whereas bytes are not; and all it takes to create an abstract base class is to use metaclass=ABCMeta and decorate as needed with @abstractmethod. Even though I'd looked at the Python documentation for both of these before, I never quite understood either of them. But, Dan's phrasing and presentation made them crystal clear on my first read.
One additional thing I like about the book is how Dan has included bits and pieces of his philosophy on Python, programming, writing good code, etc. Some people might be turned off by the editorializing, I suppose, but I really appreciate that the book provides these sorts of "meta" perspectives.
All in all, an excellent resource for someone with modest to moderate Python experience looking to round out their knowledge of some of the more subtle features/behaviors of the language.
I'm anxious to incorporate the knowledge into my Python projects to better understand those workings and to know it will be solid code too.
Thanks Dan from a Vic20/Commodore64/Amiga user starting back in '76!
Pros:
1. Good book material quality and size (small but also perfect thickness to carry around).
2. Great and interesting topics with intermediate+ level examples.
3. Concepts were very well described.
Cons:
1. Books lacks colors, It seems like HTMl version of this must have used some Markdown but the book is just plain black/white texts.
2. Wish there were some more examples per topics.
3. Chapters/Topics are short enough that *key takeaways* section can seem bit redundant. Maybe some kind of *quiz* or some kind of *small mission for readers to go find out* type of section would been more useful IMO.
But, I really enjoyed this book. So how about you give it a try as well?
Reviewed in the United States 🇺🇸 on May 23, 2019
Pros:
1. Good book material quality and size (small but also perfect thickness to carry around).
2. Great and interesting topics with intermediate+ level examples.
3. Concepts were very well described.
Cons:
1. Books lacks colors, It seems like HTMl version of this must have used some Markdown but the book is just plain black/white texts.
2. Wish there were some more examples per topics.
3. Chapters/Topics are short enough that *key takeaways* section can seem bit redundant. Maybe some kind of *quiz* or some kind of *small mission for readers to go find out* type of section would been more useful IMO.
But, I really enjoyed this book. So how about you give it a try as well?
Top reviews from other countries
The main tag line of the title "Python Tricks - the Book" I think does it a dis-service (although I recognise the link with Dan's web RealPython and the tips and tricks email series). That title suggests a collection of disjointed tips and/or sometimes pointless tricks with the language. It is far from that. Instead you get a well thought out and substantial walk through many of the more advanced aspects of the language. But it is not a dry tome in the academic style. All is explained in an informal but thorough and lucid style, and even hitherto obscure topics like decorators and lexical closures now make sense to me. Also included is a link to additional (free) online resources to reinforce the book's contents. It is a good read for expanding your horizons, and one that will remain useful as a reference work when implementing some of the techniques with which you are not overly familiar.
Not one for total beginners, but if like me you find yourself at the stage of, "Well, I think I'm now OK with the basics of python, but where do I go next?" - this is the book for you. And at the price of the Kindle version , an absolute bargain.
Reviewed in the United Kingdom 🇬🇧 on August 23, 2020
Reviewed in the United Kingdom 🇬🇧 on November 4, 2017





