deprecation of has_key?
John Roth
newsgroups at jhrothjr.com
Thu Apr 21 22:31:47 EDT 2005
"Terry Reedy" <tjreedy at udel.edu> wrote in message
news:mailman.2254.1114121746.1799.python-list at python.org...
>
> "Steven Bethard" <steven.bethard at gmail.com> wrote in message
> news:dfWdnZdcUZbqX_rfRVn-vw at comcast.com...
>> 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.
I actually use the item-pair more frequently, but it's not
something that concerns me overmuch. I don't really worry
about a few extra keystrokes; just a whole lot of extra
keystrokes.
John Roth
>
> Terry J. Reedy
>
>
>
More information about the Python-list
mailing list