...

/

Delete Method of the Descriptor Protocol

Delete Method of the Descriptor Protocol

Learn about the delete method of the descriptor protocol in detail.

Signature of the __delete__ method

The signature for the __delete__ method is simpler as opposed to the __get__ and __set__ methods, and it looks like this:

__delete__(self, instance)

Calling the __delete__ method

This method is called upon with the following statement, in which self would be the descriptor attribute, and instance would be the client object in this example:

del client.descriptor
...