'\'D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
If key is not found, d is returned if given, otherwise KeyError is raised\''

def pop(self, key, *args):

    val = dict.pop(self, key, *args)
    if (key in self.scalars):
        del self.comments[key]
        del self.inline_comments[key]
        self.scalars.remove(key)
    elif (key in self.sections):
        del self.comments[key]
        del self.inline_comments[key]
        self.sections.remove(key)
    if (self.main.interpolation and isinstance(val, basestring)):
        return self._interpolate(key, val)
    return val
