Customers who viewed this item also viewed
Used - Good
$12.29$12.29
Ships from: The Salvation Army-West Sold by: The Salvation Army-West
Sorry, there was a problem.
There was an error retrieving your Wish Lists. Please try again.Sorry, there was a problem.
List unavailable.
Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.
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
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.
- Reading age5 years and up
- Print length301 pages
- LanguageEnglish
- Dimensions6 x 0.68 x 9 inches
- Publication dateOctober 25, 2017
- ISBN-101775093301
- ISBN-13978-1775093305
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.
Frequently bought together

Deals on related products
Customers also bought or read
- Fluent Python: Clear, Concise, and Effective Programming
Paperback$43.99$43.99FREE delivery Wed, May 13 - Python Pocket Reference: Python In Your Pocket (Pocket Reference (O'Reilly))
Paperback$13.79$13.79Delivery May 22 - 29 - CPython Internals: Your Guide to the Python 3 Interpreter
Paperback$37.99$37.99FREE delivery May 19 - 25 - Effective Python: 125 Specific Ways to Write Better Python (Effective Software Development Series)
Paperback$52.80$52.80FREE delivery Wed, May 13 - Python Crash Course, 3rd Edition: A Hands-On, Project-Based Introduction to Programming#1 Best SellerIntroductory & Beginning Programming
Paperback$27.53$27.53Delivery Wed, May 13 - Python Machine Learning By Example: Unlock machine learning best practices with real-world use cases
Paperback$31.11$31.11Delivery Wed, May 13 - Machine Learning with PyTorch and Scikit-Learn: Develop machine learning and deep learning models with Python
Paperback$37.95$37.95FREE delivery Wed, May 13 - 50 Algorithms Every Programmer Should Know: Tackle computer science challenges with classic to modern algorithms in machine learning, software design, data systems, and cryptography
Paperback$35.55$35.55FREE delivery Wed, May 13 - Automate the Boring Stuff with Python, 2nd Edition: Practical Programming for Total Beginners
Paperback$23.47$23.47Delivery Wed, May 13 - Grokking Algorithms, Second Edition: An illustrated guide for programmers and other curious people
Paperback$39.70$39.70FREE delivery Wed, May 13 - Python 3: The Comprehensive Guide to Hands-On Python Programming (Rheinwerk Computing)
Paperback$43.38$43.38FREE delivery Wed, May 13 - Object-Oriented Python: Master OOP by Building Games and GUIs
Paperback$37.16$37.16FREE delivery May 17 - 19 - Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow: Concepts, Tools, and Techniques to Build Intelligent Systems
Paperback$46.73$46.73FREE delivery Wed, May 13 - Python Cheat Sheet Encyclopedia: The Fastest Way to Learn and Use Python Without Getting Overwhelmed
Paperback$12.99$12.99Delivery Wed, May 13 - Modern Python Cookbook: 130+ updated recipes for modern Python 3.12 with new techniques and tools
Paperback$43.99$43.99FREE delivery Wed, May 13 - The Big Book of Small Python Projects: 81 Easy Practice Programs
Paperback$31.99$31.99Delivery Wed, May 13 - Serious Python: Black-Belt Advice on Deployment, Scalability, Testing, and More
Paperback$25.00$25.00Delivery Thu, May 14 - Design Patterns: Elements of Reusable Object-Oriented Software#1 Best SellerObject-Oriented Design
Hardcover$31.92$31.92Delivery May 24 - 28 - Mathematics of Machine Learning: Master linear algebra, calculus, and probability for machine learning
Paperback$50.99$50.99FREE delivery Wed, May 13 - Data Science from Scratch: First Principles with Python
Paperback$44.65$44.65FREE delivery Wed, May 13
Editorial Reviews
About the Author
Product details
- Publisher : Dan Bader
- Publication date : October 25, 2017
- Edition : 1st
- Language : English
- Print length : 301 pages
- ISBN-10 : 1775093301
- ISBN-13 : 978-1775093305
- Item Weight : 15.5 ounces
- Reading age : 5 years and up
- Dimensions : 6 x 0.68 x 9 inches
- Best Sellers Rank: #445,042 in Books (See Top 100 in Books)
- #237 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 AmazonCustomers say
Generated from the text of customer reviewsSelect to learn more
Reviews with images
Great resource for intermediate Python users to round out their knowledge of the language
Top reviews from the United States
- 5 out of 5 stars
Great resource for intermediate Python users to round out their knowledge of the language
Reviewed in the United States on November 14, 2017I consider myself an 'early intermediate' Pythonista, with about three years of self-taught experience in the language, bolstered by all the good resources out there online. I first ran across Dan's page/blog through a Twitter link, I think, and have really enjoyed his Python Tricks emails. Some of them aren't news to me, but there have been multiple instances where they've given me a key insight into the behavior of Python, or an idea that's helped me improve my projects.
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.
5 out of 5 starsGreat resource for intermediate Python users to round out their knowledge of the language
Reviewed in the United States on November 14, 2017I consider myself an 'early intermediate' Pythonista, with about three years of self-taught experience in the language, bolstered by all the good resources out there online. I first ran across Dan's page/blog through a Twitter link, I think, and have really enjoyed his Python Tricks emails. Some of them aren't news to me, but there have been multiple instances where they've given me a key insight into the behavior of Python, or an idea that's helped me improve my projects.
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.
46 people found this helpfulSending feedback...Sending feedback...HelpfulThank you for your feedback.Sorry, we failed to record your vote. Please try againThanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again - 5 out of 5 stars
Wrap yourself around Python.
Reviewed in the United States on August 11, 2025If you are wanting to upgrade your knowledge of python programming, this book is for you. Dan Bader strives to impart knowledge in an easily understandable way. There are many suggestions and worked examples.
Sending feedback...Sending feedback...HelpfulThank you for your feedback.Sorry, we failed to record your vote. Please try againThanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again - 4 out of 5 stars
Useful in part
Reviewed in the United States on November 9, 2025Contains some useful stuff. Worth it? Yes but....
Sending feedback...Sending feedback...HelpfulThank you for your feedback.Sorry, we failed to record your vote. Please try againThanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again - 5 out of 5 stars
Probably one of the best programming book I've read in a while.
Reviewed in the United States on May 23, 2019I am not a big fan of reading books in general. But, I just finished reading through every chapters in this book after 13 days of daily reading. I found this book both very fun and informative. If you are looking for something more than beginner python tutorials, this book will surely do a good job to satisfy some of the thirst that you had. Here are some Pros/Cons of the book.
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?


5 out of 5 starsProbably one of the best programming book I've read in a while.
Reviewed in the United States on May 23, 2019I am not a big fan of reading books in general. But, I just finished reading through every chapters in this book after 13 days of daily reading. I found this book both very fun and informative. If you are looking for something more than beginner python tutorials, this book will surely do a good job to satisfy some of the thirst that you had. Here are some Pros/Cons of the book.
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?
7 people found this helpfulSending feedback...Sending feedback...HelpfulThank you for your feedback.Sorry, we failed to record your vote. Please try againThanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again - 5 out of 5 stars
A quick read to fill in any gaps in your python knowledge
Reviewed in the United States on January 1, 2018I'm an advanced python user and have worked at several startups, Google, and Microsoft, but I still found several tips in here that were new to me, and many others that I only knew because I'd learned them from colleagues when I worked at Google. For instance, I would usually just define an __str__ method on my custom classes and be lazy and not implement __repr__. But the book points out that if you want be lazy, just define __repr__ alone, as the default behavior of __str__ will call your __repr__ function anyway. I should have known this already but somehow it's a little thing I had missed when learning python. There are lots of bits of info like this: some you'll probably already know, but you might be surprised by a couple little tricks.
One outstanding feature of the book is a short recap after each section, giving simple rules of thumb to to follow. This cleared up a lot of uncertainty for me about some python best practices. I really like the book "Fluent Python" as well, but this one has more simple and practical suggestions and was a very quick read.
Highly recommended!
28 people found this helpfulSending feedback...Sending feedback...HelpfulThank you for your feedback.Sorry, we failed to record your vote. Please try againThanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again - 5 out of 5 stars
Outstanding!!
Reviewed in the United States on June 9, 2023I am a prior IBM employee & retiree. I coded in Fortran, 360 assembler, Cobal, RPG2 for S/3 and AS400 level systems, Visual Basic, C, C++, VBA for Access, Excel, Word, etc. I was always a "part time" programmer in a consulting role. I decided to tackle, or be tackled by, Python in my retirement. I know I am not saying anything that is unknown by stating Python is NOT an easy learn. But, I can also say that I am definitely enjoying the challenge. This book is my favorite of the many quality instruction offerings provided by Real Python. I know I will be re-reading this book many times over. Great job !
7 people found this helpfulSending feedback...Sending feedback...HelpfulThank you for your feedback.Sorry, we failed to record your vote. Please try againThanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again - 5 out of 5 stars
A "must have" book for anyone who's serious about learning Python
Reviewed in the United States on May 3, 2023I'm new to Python. This book clarified some fuzzy concepts, and it introduced me to several new concepts.
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.
3 people found this helpfulSending feedback...Sending feedback...HelpfulThank you for your feedback.Sorry, we failed to record your vote. Please try againThanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again - 4 out of 5 stars
Good book. But prefer Fluent Python.
Reviewed in the United States on November 7, 2017The main reason why I bought the book is because I like Dan's blog.
I consider my Python level to be intermediate. I have completed reading 100 pages(1/3 of the book). Although the content is decent, this feels like it is targeted more towards beginner(not an absolute beginner) than intermediate level. I am hardly learning anything new that is already not in Fluent Python (which is a big ass book in comparison but provides better understanding of the Pythonic tricks) or in Raymond Hettinger or David Beazley’s videos on YouTube.
I will update the review once I finish reading the entire book.
Update: I finished reading the book and I still stand by what I said earlier. If you have time and patience, go with Fluent python. Other than the new style string formatting, rest of the content is mostly covered in that.
That does not mean this is not a good book. I really loved some of the chapters like generators, iterators. The examples were more simple and easy to understand. Overall, I found this book to be more of a tutorial than a reference material. Mainly because I use the excellent pymotw website for the Collections part of the book.
212 people found this helpfulSending feedback...Sending feedback...HelpfulThank you for your feedback.Sorry, we failed to record your vote. Please try againThanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again
Top reviews from other countries
MST5 out of 5 starsZnakomita, nadal aktualna
Reviewed in Poland on June 15, 2024Znakomita książka dla osób które potrafią co nieco programować w Pythonie, ale zdają sobie sprawę, że są w tym języku pewne konstrukcje, które nie wiadomo do czego służą, nie wiadomo w jakich sytuacjach warto z nich skorzystać, do czego mogą być potrzebne i są często pomijane w tutorialach dla początkujących. Autor świetnie nawiązuje do własnych doświadczeń, wskazując na te elementy, których sam do końca nie rozumiał i nie używał programując kiedyś w Pythonie. W bardzo przystępny sposób, na trafionych przykładach, rozkłada na czynniki pierwsze przeznaczenie takich elementów, potencjalne scenariusze wykorzystania i potencjalne błędy jakie mogą wynikać z braku zrozumienia ich mechaniki działania. Dodatkowo do książki dostajemy dostęp do 12-stu dodatkowych lekcji video. Fajny, lekki język, trafiona tematyka, sprawiająca że czytając wstęp rozdziałów czytelnik zdaje sobie sprawę, że ma podobne odczucia co autor na początku jego kariery programowania. Wzbudza to naturalną ciekawość, po co to jest, jak działa i czy potrzebuję z tego kiedykolwiek korzystać. Książka nadal aktualna w roku 2024, warta zakupu. Przyzwoite wydanie papierowe. Polecam.
Sending feedback...Thanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again
Programmer5 out of 5 starsPerfect book
Reviewed in Canada on November 30, 2023Good information with examples and easy to read
Sending feedback...Thanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again
Gero Zayas5 out of 5 starsEs un libro MAGNÍFICO y con ejemplos de código espećificos.
Reviewed in Spain on February 1, 2025Se aleja de platitudes y te enseña verdaderamente cómo mejorar tu nivel de Python. Es un libro que siempre recomendaría a Python developers, 100%.
Sending feedback...Thanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again
Alessandro5 out of 5 starsUn ottimo libro, tanti consigli utili, uno stile accattivante
Reviewed in Italy on November 8, 2017Il libro si rivolge sostanzialmente a chi il Python lo conosce già, ma desidera aumentare e migliorare le proprie conoscenze scrivendo codice sempre più in stile pythonico
Una serie di piccoli esempi, presentati in modo chiaro e divertente al tempo stesso, illustrano molte delle funzionalità base e non del linguaggio.
Da semplici trucchi a veri e propri design pattern, Dan ripropone in un libro organico e completo la serie di tweet e mail della sua newsletter.
Proprio per la tipologia dei contenuti, il libro può essere letto andando in ordine o saltando da un argomento all'altro.
Come dice l'autore, nel primo caso quando arriverete in fondo, avrete la certezza di averlo letto tutto :)
5 out of 5 starsUn ottimo libro, tanti consigli utili, uno stile accattivante
Reviewed in Italy on November 8, 2017Il libro si rivolge sostanzialmente a chi il Python lo conosce già, ma desidera aumentare e migliorare le proprie conoscenze scrivendo codice sempre più in stile pythonico
Una serie di piccoli esempi, presentati in modo chiaro e divertente al tempo stesso, illustrano molte delle funzionalità base e non del linguaggio.
Da semplici trucchi a veri e propri design pattern, Dan ripropone in un libro organico e completo la serie di tweet e mail della sua newsletter.
Proprio per la tipologia dei contenuti, il libro può essere letto andando in ordine o saltando da un argomento all'altro.
Come dice l'autore, nel primo caso quando arriverete in fondo, avrete la certezza di averlo letto tutto :)
Sending feedback...Thanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again
lain4 out of 5 starsわかりやすい
Reviewed in Japan on October 28, 2020原書の英語版のKindle版を購入。
文章もコードもわかりやすくて良い。知らなかったコツ、ちょっとした工夫がたくさんあって良かった。
Kindle版ならば、PC版アプリでそれを閲覧しながら、すぐ横に開いたエディタでコードがかけるので利便性が高い。
実際に見ながらコードを書きたい人は、Kindle版を買うほうが絶対に便利。
Sending feedback...Thanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again






















