Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What is a decorator?
Think about what happens before and after a function runs.
What does the @ symbol signify in Python?
What might a function look like with a decorator applied?
What is the primary purpose of a decorator?
Think about what decorators are usually used for in Python.
True or False: Descriptors are used exclusively for classes.
Recall the definition of descriptors.
Implement a decorator that logs execution time of functions.
Focus on timing functions while they execute.
Create a custom descriptor that only accepts strings of a specified length.
Think about how to enforce lengths within the descriptor.
6 more questions in this section. Enroll free to practise them all.
Enroll free