Nadeem Vawda <nadeem.va...@gmail.com> added the comment: > "popitem() > Remove and return an arbitrary (key, value) pair from the dictionary. Raises > KeyError if the dict is empty. Use next(iter(d)) to return an arbitrary pair > without removing it."
Actually, next(iter(d)) on a dict returns an arbitrary *key*; if you want a pair, you need next(iter(d.items())). ---------- nosy: +nadeem.vawda _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue14836> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com