Steven D'Aprano <ste...@remove.this.cybersource.com.au> wrote: > if you don't trust the language to behave > correctly in this case: > > pairs = zip(d.values(), d.items()) > > what makes you think you can trust d.iteritems(), list comprehensions, or > even tuple packing and unpacking?
Because .iteritems() is an atomic operation while the .values/.items approach is two independent calls. That the former binds the two together in its implementation makes sense, that two _independent_ methods are bound feels far more like magic. -- http://mail.python.org/mailman/listinfo/python-list