Getting Tired

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

has_key is obviously a method of an instance of class dict.

Oh really? Why is the has_key() method deprecated in Python 3.0 then?

···

On Wed, May 7, 2008 at 10:55 PM, Phillip Watts phillip.watts@anvilcom.com wrote:

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

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.


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Because someone decided to make something ugly of something clean.
Happens all the time.

If 'orange' in fruit:

What does that mean? Is 'orange' a key, data, a column, a method, an
attribute. Depends on the context doesn't it. Ugly.

···

On Wednesday 07 May 2008 16:35:29 Chester wrote:

> has_key is obviously a method of an instance of class dict.

Oh really? Why is the has_key() method deprecated in Python 3.0 then?

has_key is obviously a method of an instance of class dict.

Oh really?

Yes.

Why is the has_key() method deprecated in Python 3.0 then?

Dunno. What does that have to do with the point under
discussion?

···

On 2008-05-07, Chester <wxpythoner@gmail.com> wrote:

--
Grant Edwards grante Yow! ... My pants just
                                  at went on a wild rampage
                               visi.com through a Long Island
                                                   Bowling Alley!!