Exercises -- Descriptors

  1. 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.
  2. Implement a test class that uses your descriptor class to create an instance variable with managed access.
  3. 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:

More information: