def METHOD_NAME(self):
    if len(self) == 0:
        raise IndexError("Cannot pop from empty list")
    result = self[-1]
    self.__len -= 1
    if self.__mask is not None:
        self.__mask.METHOD_NAME(self.__len, None)
    return result