Python: Decorators

Lab Steps

lock
Web IDE Review
lock
Decorators
lock
Demonstrate Your Knowledge
lock
Solution

The hands-on lab is part of this learning path

Ready for the real environment experience?

DifficultyAdvanced
Time Limit1h
Students7

Description

Learn how to wrap callables using Python's decorator syntax.

Decorators allow callables to be expanded or augmented without modifying the original. They're commonly used in web application frameworks for routing, authentication, etc. They're used to parameterize unit tests with pytest. In addition to many other use cases.

This lab introduces decorators through hands-on examples and ends with the chance to practice what you've learned.

Prerequisites:

  • Proficient with:
    • The Python runtime
    • The Python language syntax
About the Author
Students95980
Labs28
Courses46
Learning paths54

Ben Lambert is a software engineer and was previously the lead author for DevOps and Microsoft Azure training content at Cloud Academy. His courses and learning paths covered Cloud Ecosystem technologies such as DC/OS, configuration management tools, and containers. As a software engineer, Ben’s experience includes building highly available web and mobile apps. When he’s not building software, he’s hiking, camping, or creating video games.

Covered Topics