Denis S. Otkidach wrote:
On Thu, 21 Apr 2005 08:50:25 -0600 Steven Bethard wrote:

SB> Huh? I'm not following your logic. Why is "item in dict" less
SB> readable than "dict.has_key(item)"? Something to do with expecting
SB> inverses that don't exist?
SB> SB> Personally, I use "item in dict" because it's quite readable to me,
SB> and generally faster.


For me dictionary is a collection of key-value pairs, but not a
collection of keys (that's what set is).

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. ;)


STeVe
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to