Search the courses, subjects, tracks, games and features, or jump straight to a page.
4 cards from this section. Quick, good the night before a test.
What is a function decorator?
Think about wrapping functions.
Give an example of a built-in decorator in Python.
Consider decorators used in classes.
What is the purpose of a function decorator?
Think about the meaning of 'decorating' a function.
True or False: A decorator must always take no arguments.
Consider decorators like @repeat(n).
Create a memoization decorator that caches results of function calls.
How can you identify unique function outputs?
Implement a class decorator that automatically adds a logging method to any class it decorates.
Think about how to add methods to a class dynamically.
6 more questions in this section. Enroll free to practise them all.
Enroll free