[Python-Dev] Let's stop eating exceptions in dict lookup

Steve Holden steve at holdenweb.com
Mon Jun 5 16:42:52 CEST 2006

Raymond Hettinger wrote:
> Armin Rigo wrote:
>>At the moment, I'm trying to, but 2.5 HEAD keeps failing mysteriously on
>>the tests I try to time, and even going into an infinite loop consuming
>>all my memory - since the NFS sprint.  Am I allowed to be grumpy here,
>>and repeat that speed should not be used to justify bugs?  I'm proposing
>>a bug fix, I honestly don't care about 0.5% of speed.
> If it is really 0.5%, then we're fine.  Just remember that PyStone is an 
> amazingly uninformative and crappy benchmark.
Which sadly doesn't distinguish it particularly, since all benchmarks 
tend towards the uninformative and crappy.

> The "justify bugs" terminology is pejorative and inaccurate.  It is 
> clear that the current dict behavior was a concious design decision and 
> documented as such.  Perhaps the decision sucked and should be changed, 
> but it is not a bug.
>> and I consider
>>myself an everyday Python user,
> Something may have been lost in translation.  Using it every day is not 
> the same as being an everyday user ;-)  There is no doubt that you 
> routinely stress the language in ways ways that are not at all commonplace.
Just the same, I think Armin's point that the change in behavior might 
induce breakage in "working" programs is one we need to consider 
carefully, even though programs relying on the current behaviour might 
reasonably be considered broken (for some value of "broken").

> All I'm asking is that there be a well thought-out assessment of whether 
> the original design decision was struck the appropriate balance between 
> practicality
I think the discussion has touched all the major points, but this won't 
stave off the squeals of anguish form those running programs that break 
under 2.5.

There are some similarities between this change and the (2.0?) change 
that stopped socket.socket() from accepting two arguments. IMHO I think 
we should accept that the behaviour needs to change and be prepared for 
a few anguished squeals. FWIW I suspect they will be even fewer than 

Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC/Ltd          http://www.holdenweb.com
Love me, love my blog  http://holdenweb.blogspot.com
Recent Ramblings     http://del.icio.us/steve.holden

More information about the Python-Dev mailing list