dictionary.update() enhancement?

Bengt Richter bokr at accessone.com
Sat Oct 13 21:15:21 EDT 2001


On Fri, 12 Oct 2001 22:54:27 -0400, "Tim Peters" <tim.one at home.com> wrote:

>[Mark J]
[...]
>> would be called with the two respective values when a key collision
                                                  ^^^^^^^^^^^^^^^^^^^^
>> occurs.
   ^^^^^^
[...]
>
>Unfortunately, it would be slower than hand iteration.  David Bolen went
>into the most detail about that, and he's right:  the overhead of calling
>back into a Python function each time would kill performance.
                             ^^^^^^^^^

ISTM you're talking about different things ;-)

The way I read it, the collision *detection* would be done
without calling the policy-defining function (presumably
in C modified to make the test in C and conditionally call back).

Then results would depend on the collision percentage, but
in general there should be a gain over a totally-by-hand loop, IWT.




More information about the Python-list mailing list