Python __delitem__() Magic Method
Python’s magic method __delitem__(self, key) implements the deletion of self[key]. So, if you call del self[key], Python will call self.__delitem__(key). We call this a “Dunder Method” for “Double Underscore Method” (also called “magic method”). To get a list of all dunder methods with explanation, check out our dunder cheat sheet article on this blog. Syntax … Read more