2 - Python Decorators and Descriptors
Enroll to start learning
You’ve not yet enrolled in this course. Please enroll for free to listen to audio lessons, classroom podcasts and take practice test.
Practice Questions
Test your understanding with targeted questions
What is a decorator?
💡 Hint: Think about what happens before and after a function runs.
What does the @ symbol signify in Python?
💡 Hint: What might a function look like with a decorator applied?
4 more questions available
Interactive Quizzes
Quick quizzes to reinforce your learning
What is the primary purpose of a decorator?
💡 Hint: Think about what decorators are usually used for in Python.
True or False: Descriptors are used exclusively for classes.
💡 Hint: Recall the definition of descriptors.
2 more questions available
Challenge Problems
Push your limits with advanced challenges
Implement a decorator that logs execution time of functions.
💡 Hint: Focus on timing functions while they execute.
Create a custom descriptor that only accepts strings of a specified length.
💡 Hint: Think about how to enforce lengths within the descriptor.
Get performance evaluation
Reference links
Supplementary resources to enhance your learning experience.