Next Step Python: Decorators

Next Step Python: Decorators

English | MP4 | AVC 1280×720 | AAC 44KHz 2ch | 0h 55m | 108 MB

Decorators are an increasingly important feature in Python. They add functionality to an existing object without permanently modifying it. Being able to use decorators effectively is critical to working with larger Python projects and frameworks. In this course, Jonathan Fernandes explains what decorators are and why they are used so extensively in production projects. He explains how to solve common challenges associated with decorators, such as debugging; how to chain decorators; how to use decorators with classes; and how to access the arguments passed into decorated functions. Plus, find out how to use and debug decorators in the real world by examining decorators’ role in the source code for the Flask microplatform.

Topics include:

  • Working with functions in Python
  • Beautifying output
  • HTML styling
  • Using decorators with arguments
  • Using decorators with classes
  • Identifying decorators in Flask source code
Table of Contents

Introduction
1 Decorators in Python

Functions
2 Working with functions in Python
3 Functions within functions

Getting Started
4 What are decorators
5 Challenge Beautify your output
6 Solution Beautify your output
7 Challenges with debugging
8 Challenge HTML styling with decorators
9 Solution HTML styling with decorators

Decorators with Arguments
10 Functions with args and kwargs
11 Decorators with args and kwargs
12 Use decorators to time functions
13 Challenge Decorators with arguments
14 Solution Decorators with arguments

Decorators with Classes
15 Classes and decorators in Python
16 Use decorators as a cache

Decorators in the Real World
17 Install Flask
18 Run Flask
19 The route function in Flask

Conclusion
20 Experiment with decorators in Python