Intermediate Python: Master Decorators From Scratch



A Comprehensive Introduction to Decorators In Python with Several Practical Applications

What you will learn

Understand what decorators are and how they are used in python functional programming

Write advanced, flexible decorators to handle caching, performance timing, logging, and more

Master the syntax and, more importantly, the core ideas behind decorators

Get ample practice through 12 coding assignments, followed by detailed solutions

Description

Welcome to the best and most complete guide to Python decorators!

In this course, you’ll cultivate a deep and practical understanding of decorators in Python, starting from the very basics. This beginner-friendly course is meticulously crafted to ensure you build a solid foundation from scratch while also getting ample practice in the process.

Before diving into decorators, we’ll explore the fundamental principles that serve as the building blocks of this intriguing topic. You’ll gain a deep understanding of higher-order functions, closures, and first-class functions – prerequisites that unlock the magic of decorators. Foundational topics include:

  • Closures
  • First-Class Functions
  • Variadics
  • Higher Order Functions

Once we have established a solid grasp of these functional foundations, we’ll dive into the captivating world of decorators. We’ll start with a gentle introduction and gradually move towards more intricate techniques. Our exploration of decorators will include:


  • Basic Decorators
  • Decorating Parameterized Functions
  • Chaining Decorators
  • Decorating Functions With Variable Arity
  • Preserving Metadata of Decorated Functions

But that’s not all! Each concept will be reinforced through engaging coding assignments of increasing difficulty. Throughout the course, will also explore several skill challenges inspired by real-world scenarios including:

  • Logging Function Output
  • Timing Runtime Performance
  • Using Decorators In Mocked Authentication Flows
  • Creating Cache Mechanisms

This course is tailored specifically for Python programmers interested in deepening their understanding of decorators as a gateway to functional programming or as a standalone, intermediate-level programming pattern.

See you inside!

English
language

Content

Course

VERY Short Intro!
Course Resources
Introduction to Python Functions
Skill Challenge: Averaging Grades
Solution
More On Functions: *args and **kwargs
Skill Challenge: Variadics
Solution
Higher-Order Functions
Skill Challenge: Arithmetic HOF
Solution
First-Class Functions
Closures
Skill Challenge: Counter Factory
Solution
Basic Introduction To Decorators
Decorating Parameterized Functions
Skill Challenge – Let’s Log
Solution
Skill Challenge – Lotto Draws
Solution
Skill Challenge – Writing A Timer
Solution
Decorators With Arguments
Skill Challenge – Repeated Lotto Draws
Solution
Chaining Multiple Decorators
Preserving Identity With @wraps
Skill Challenge – Delaying Downloads
Solution
Skill Challenge – Authentication Workflow Part I
Solution Part I
Skill Challenge – Authentication Workflow Part II
Solution Part II
Skill Challenge – Building A Cache
Solution

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Powered By
100% Free SEO Tools - Tool Kits PRO

Check Today's 30+ Free Courses on Telegram!

X