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

Roel Schroeven rschroev_nospam_ml at fastmail.fm
Fri Dec 8 05:54:26 EST 2006


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.

-- 
If I have been able to see further, it was only because I stood
on the shoulders of giants.  -- Isaac Newton

Roel Schroeven



More information about the Python-list mailing list