On 9/12/2013 2:24 PM, Markus Rother wrote:

Dictionaries should iterate over their items instead of their keys.

Dictionaries *can* iterate by keys, values, or items. You would prefer that the default iteration be by items rather than keys.

Looking forward to contrary opinions.

When the issue was discussed and decided, a majority of developers preferred keys. A large factor was experience and expectation that iterating by keys is more common than than iterating by items, coupled with the idea that the most common usage should be the default.

--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to