non-destructive version of pop() for a dictionary k, v = next(iter(d.items())) # updated for Python 3