'Removes and returns a key or index.
:param key: The key to be popped.  If this is an integer the item at
that position is removed, if it\'s a string the value for
that key is.  If the key is omitted or `None` the last
item is removed.
:return: an item.'

def pop(self, key=None, default=_missing):

    if (key is None):
        return self._list.pop()
    if isinstance(key, integer_types):
        return self._list.pop(key)
    try:
        rv = self[key]
        self.remove(key)
    except KeyError:
        if (default is not _missing):
            return default
        raise
    return rv
