Book Review: Guide to Learning Python Decorators

by Amit


Matt Harrison’s Guide to: Learning Python decorators is a mini-book dedicated to the topic of decorators in Python.

He starts off with a brief introduction to programming paradigms and subsequently introducing the concept of Python supporting first-class functions. He talks about function attributes, scope in functions and nested functions. Next, he introduces the topic of function arguments/parameters, the * and ** operators and related concepts.

(I like the way he builds up the book, starting from the very basics of functions)

Next, he introduces the concept of closures in a very easy fashion.  Reading this chapter you will feel ‘Huh? That’s it?’.

Finally, he comes to the chapter on decorators. First he introduces a simple decorator; then he talks about decorators with parameters, multiple decorators and ends with simple uses of decorators.

Short and sweet.

 

Advertisements