.__delitem__() method is
another special method that is called when the user
applies the Python
to one element of a skip list. It's really the same
thing as the
except the caller doesn't want the deleted item.
In the case where there are multiple children with the
same key, it's not obvious whether a user would expect to
delete all of them. We arbitrary say it will delete only
one. If one wishes to delete them all, one can always
write a loop that calls
until it returns a
None to signify
that no elements were deleted.
# - - - S k i p L i s t . _ _ d e l i t e m _ _ - - - def __delitem__ ( self, key ): """Delete the first or only item with a given key.""" self.delete ( key )