Mike Meyer wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > Which is also my initial puzzle, items() and iteritems() already gives > > you the tuples, why such gurantee or the others ? Doesn't that violate > > the general idiom that if we can do certain thing in one way, there > > better be one and only one way. > > Backwards compatability. The guarantee on the order of keys() and > values() predates items() (and iteritems()). You can't remove the > guarantee without potentially breaking old code, and that's Not Done - > at least not to code that wasn't broken to begin with. > > Maybe dropping the guarantee should be considered for P3K, on the off > chance that either keys or values could be made faster at some point > in the future. But I don't see it as a big deal. > Thanks, that explain it. I don't know that there was no items()/iteritems() in earlier version.
-- http://mail.python.org/mailman/listinfo/python-list