I disagree. has_key is obviously a method of an instance
of class dict.
Just like append is a method of list.
"if ... in" on the other hand is a specialized construct of Python.
One reason I like Python is that it has few of these.
So you say Ugly...Clean. I say Obj oriented....context sensitive.
Could we quit filling up the emails with arguments about
beauty, I think that's for the developer list.
···
On Wednesday 07 May 2008 15:12:08 Tim van der Leeuw wrote:
On Wed, May 7, 2008 at 10:05 PM, Chester <wxpythoner@gmail.com> wrote:
> my_dictionary = {"banana": 123, "orange": 456}
>
> if my_dictionary.has_key("orange"): UGLY
> ...
>
> if "orange" in my_dictionary: CLEAN
> ...