'Remove all object instances from this ``Session``.
This is equivalent to calling ``expunge(obj)`` on all objects in this
``Session``.'

def expunge_all(self):

    for state in (self.identity_map.all_states() + list(self._new)):
        state._detach()
    self.identity_map = self._identity_cls()
    self._new = {}
    self._deleted = {}
