list index()

Neil Cerutti horpner at yahoo.com
Thu Aug 30 14:51:39 EDT 2007


On 2007-08-30, zzbbaadd at aol.com <zzbbaadd at aol.com> wrote:
>> That wish will only come true if you maintain your own fork of
>> Python 3. has_key() will go away, period. It has been made
>> obsolete by "in", which is faster and more concise.
>
> Is there really some reason  "key" IN dict can be implemented
> faster than dict.has_key("key")???

Yes. Looking up the has_key method by name is the slower part.

-- 
Neil Cerutti
We're not afraid of challenges. It's like we always say: If you want to go out
in the rain, be prepared to get burned. --Brazillian soccer player



More information about the Python-list mailing list