Using Python 3, I would like to get an element (any element) from a dict without making a list of all of the elements.
In Python 2, I did this:
next(foo.itervalues())
In Python 3, none of these work:
next(foo.values())
next(foo.items())
next(foo)
Of course I can do this:
list(foo.values())[0]
but that makes a list of the whole dict before returning the first one.
You cannot assume that I know a key. Also, the dictionary may not be altered.