dict.has_key(x) versus 'x in dict'

Hendrik van Rooyen mail at microcorp.co.za
Sat Dec 9 01:48:47 EST 2006


 "Roel Schroeven" <rschroev_nospam_ml at fastmail.fm> wrote:


> Hendrik van Rooyen schreef:
> > <skip at pobox.com> wrote:
> >
> >>     Hendrik> - as long as it works, and is fast enough, its not broken, so
> >>     Hendrik> don't fix it...
> >>
> >> That's the rub.  It wasn't fast enough.  I only realized that had been a
> >> problem once I fixed it though.
> >
> > LOL - this is kind of weird - it was working, nobody complained, you fiddled
> > with it to make it faster, (just because you could, not because you had to,
or
> > were asked to), it became faster, and then, suddenly, retrospectively,
> > it became a problem ????
> >
> > Would it have been no problem if it so happened that you were unable to make
it
> > go faster?
> >
> > I don't really follow that logic - but then I have never believed that I
could
> > change yesterday...
>
> Have you never experienced the following:
>
> A customer reports a bug. Upon investaging you find the source of the
> problem, but from studying the code you don't understand anymore how it
> has ever been able to function correctly. From that moment, it indeed
> stops working even on computers where it always have worked correctly.
>
> You fix the bug and all is well again.
>
> Very strange, but it has happened to me on a few occasions. There's
> probably a perfectly logical explanation for what happened, but I never
> found it.
>

This is simply a manifestation of the faith that can move mountains - while
everybody believed that it was working, it did, and stopped working only because
of the heretical doubt of some infidel...

:-)    - Hendrik




More information about the Python-list mailing list