In article <[EMAIL PROTECTED]>, "Terry Reedy" <[EMAIL PROTECTED]> wrote:
> "Steven Bethard" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Ahh, ok. Now I understand. I think you could probably search the > > python-dev archives and see why the decision was made as it was. For > > pretty much all my purposes, "key in dict" is much more useful than "item > > in dict". Practicality beats Purity and all. ;) > > In '[for] x in mydict:', x could potentially be key, value, or item-pair. > All three were considered and discussed -- I believe on clp-- and key > chosen as the most useful. A specific analogy brought forth was the phone > book, a mapping of names to phone number and maybe address. The decision > was definite closer to a coin-toss to a no-brainer. The main argument was that nothing but "key in d" made sense (for __contains__), and that therefore "for key in d" was the only option, for symmetry with the other "in". Just -- http://mail.python.org/mailman/listinfo/python-list