Kindle Price: $4.99

Save $3.98 (44%)

These promotions will be applied to this item:

Some promotions may be combined; others are not eligible to be combined with other offers. For details, please see the Terms & Conditions associated with these promotions.

Deliver to your Kindle or other device

Deliver to your Kindle or other device

Guide to: Learning Python Decorators by [Harrison, Matt]
Kindle App Ad

Guide to: Learning Python Decorators Kindle Edition

4.5 out of 5 stars 26 customer reviews

See all 5 formats and editions Hide other formats and editions
Price
New from Used from
Kindle
"Please retry"
$4.99

Length: 68 pages Enhanced Typesetting: Enabled Page Flip: Enabled

click to open popover

Enter your mobile number below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.
Getting the download link through email is temporarily not available. Please check back later.

  • Apple
  • Android
  • Windows Phone
  • Android

To get the free app, enter your mobile phone number.


Editorial Reviews

Review

Succinct, focused
This inexpensive ebook is a little gem. Matt gives tight, crystal clear explanations that I haven't found anywhere else.
- J. Adams
 
 
Cleaned up some ugly with closures today, after reading @__mharrison__'s decorators ebook.
- @MattJDarling

About the Author

Matt Harrison Matt Harrison has over 11 years Python experience across the domains of search, build management and testing, business intelligence and storage.
He has presented and taught tutorials at conferences such as SCALE, PyCON and OSCON as well as local user conferences. The structure and content of this book is based off of first hand experience teaching Python to many individuals.
He blogs at hairysun.com and occasionally tweets useful Python related information at @__mharrison__.

Product Details

  • File Size: 432 KB
  • Print Length: 68 pages
  • Simultaneous Device Usage: Unlimited
  • Publication Date: January 18, 2012
  • Sold by: Amazon Digital Services LLC
  • Language: English
  • ASIN: B006ZHJSIM
  • Text-to-Speech: Enabled
  • X-Ray:
  • Word Wise: Not Enabled
  • Lending: Enabled
  • Enhanced Typesetting: Enabled
  • Amazon Best Sellers Rank: #162,995 Paid in Kindle Store (See Top 100 Paid in Kindle Store)
  •  Would you like to give feedback on images or tell us about a lower price?

Customer Reviews

Top Customer Reviews

Format: Kindle Edition Verified Purchase
Once past "hello, world!" most beginners go through a long period of monkey-see-monkey-do learning to cobble together a collection of phrases that seem to work, although you're never exactly sure why. Eventually you run up against problems that you can't find a good example for and you have to do the hard work of understanding exactly what it is that you have asked your code to do. This is the beginning of the real learning.

One of the terms that floats around is the mysterious "decorator" that never seems urgent enough to look into, although they turn out to be quite useful. If you have been meaning get around to looking into this, the Guide to Learning Python Decorators is the place to start. But that's actually not the compelling reason for most Python newcomers to pick up this book.

A common source of beginner confusion is the "scope" of variables in functions: "I've written this function and it takes some values as input and derives a result through multiple steps. I can get the final result, but not all the intermediate variables that I've set. What gives?" This and similar questions arise from confusion as to when names are available within a function definition and when they are available to other functions and statements. It's sort of like trying to understand a language without knowing the difference between the present tense ("I am") and the past tense ("I was").

This book will clear up your confusions about functions even before you start to read about decoration at all. In addition to getting straight about scope, you'll finally get clarity about the difference between arguments and parameters, positional parameters, named parameters, etc.
Read more ›
Comment 20 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Kindle Edition Verified Purchase
A clear and concise book. The author clearly explains the issue, bottom up: python functions, arguments, parameters, closures and finally decorators. The english is clear, so it's easy to understand the concept.
However, for a price of a full book, you could expect some advanced material: more about multiple decorators (which are only reminded in one page at the end), exceptions, detailed examples of common usage, class decorators etc.
Comment 8 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Kindle Edition Verified Purchase
Recently, in a post titled "Python decorators" on the PythonConquersTheUniverse blog, I described what I think is wrong about most introductions to decorators, and I sketched out what I think is a better way to structure an introduction to decorators. In that post I wrote this:

There is an old saying to the effect that "Every stick has two ends, one by which it may be picked up, and one by which it may not." I believe that most explanations of decorators fail because they pick up the stick by the wrong end.

What I like about Matt Harrison's e-book "Guide to: Learning Python Decorators" is that it is structured in the way that I think an introduction to decorators should be structured. It picks up the stick by the proper end.

The first two-thirds of the Guide hardly talk about decorators at all. Instead, Matt begins with a thorough discussion of how Python functions work. By the time the discussion gets to decorators, we have been given a strong understanding of the internal mechanics of functions. And since most decorators are functions, at that point it is easy for Matt to explain the internal mechanics of decorators.

Which is just as it should be.

So I am happy to rate "Guide to: Learning Python Decorators" as HIGHLY RECOMMENDED.
Comment 4 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Kindle Edition
This is a concise guide that covers all the necessary background in order to understand decorators.

Although many python programmers use decorators in their code, very few know how to write a decorator. Writing a decorator is considered an advanced skill and this book does an excellent job of demystifying it.

The book has dedicated sections to cover nested functions, variable function parameters, the * operator (*args, **kwargs) and closures, which are all advanced concepts that lead up to decorators.

This books serves as a stand-alone manual to python decorators. I'd highly recommend it for beginners and experts who are trying to level-up their python chops.
Comment 6 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Kindle Edition Verified Purchase
If you have never looked at or written python decorators before, this is a good book to go through the background of how and why they work, and a few examples of them in action.

It is a well written guide, however it did seem like just as you were getting to what would be the good detailed examples or advanced use cases the book just ended.

Edit: After having this book for a few months it has become very useful as the goto reference anytime I have to use decorators. For how much use I have gotten out of this guide it is definitely worth it.
2 Comments 2 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Kindle Edition Verified Purchase
The book isn't really about decorators.Well, it gives a very nice introduction to functions in Python. I also admit that it clearly explains the concept of closures.

But then we directly jump into the chapter about decorators. It mentions a few contexts in which decorators might be handy. The author explains how to construct decorators. And then... the book is over. It is neither a thorough study how to use the concept, nor a handful of hints...

There are many code examples in the book. Unfortunately, some are clearly wrong. It appears that the author didn't test these examples before putting them into the text.
Comment 4 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse

Most Recent Customer Reviews

Set up an Amazon Giveaway

Guide to: Learning Python Decorators
Amazon Giveaway allows you to run promotional giveaways in order to create buzz, reward your audience, and attract new followers and customers. Learn more about Amazon Giveaway
This item: Guide to: Learning Python Decorators