Which of the following best describes a Python descriptor?

Python Professional Hard

Python Professional — Hard

Which of the following best describes a Python descriptor?

Key points

  • Descriptors define `__get__`, `__set__`, and `__delete__`
  • They customize attribute access on another object
  • Not all objects with `__init__` are descriptors
  • Not all objects with `__repr__` and `__str__` are descriptors

Ready to go further?

Related questions