list index()

Chris Mellon arkanes at gmail.com
Thu Aug 30 14:57:09 EDT 2007


On 8/30/07, 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. As an exercise, I wont tell you the first most obvious reason -
see if you can figure it out. The dis module may help.



More information about the Python-list mailing list