Exercises -- Descriptors
- Implement a descriptor class that manages access (get and set) to
an instance variable. Use the logging module in the Python
standard library to log both "get" and "set" access to your
managed variable and to show that your "management" code is
actually called.
- Implement a test class that uses your descriptor class to create
an instance variable with managed access.
- Write some code that creates an instance of your test class. Set
and get the value of the managed instance variable.
What you will learn:
- How to implement a descriptor.
- How to use the logging class.
More information: