Jeff Shannon <[EMAIL PROTECTED]> wrote: ... > But, you generally don't "retrieve" _keys_ from dicts. You *use* keys > to retrieve *values* from a dict. The only way to get a dict to give > you a key is by using the keys() method (or items() method) to give you > *all* of the keys.
There are a few more cases, such as iterating on the dict (directly or via iterkeys or iteritems), and also the pop method. This does not invalidate your thesis that retrieving keys is a rarer use case than using keys to retrieve values -- I think you're right about that (hard to prove, but that's how it seems to me, too). Alex -- http://mail.python.org/mailman/listinfo/python-list