'Restore most recently pushed input parameters (interactive,
self.stdin, linenumber etc).  Use this if implementing a
command like read.  Push the current input, read the file and
then pop the input to go back to before.'

def pop_input(self):

    assert (len(self._input_stack) > 1)
    d = self._input_stack.pop()
    for (k, v) in d.items():
        setattr(self, k, v)
