unintuitive dict timings
Bob van der Poel
bvdpoel at kootenay.com
Sun Oct 12 19:45:44 EDT 2003
Alex Martelli wrote:
>
> def sede(key, val):
> d.setdefault(key, []).append(val)
>
> appears to be very marginally fastest, but again it's a close call:
Ahhh, an example of setdefault(). I looked at this in the docs but it
really didn't make much sense.... I'll give this a try just to see what
difference it makes.
Thanks.
--
Bob van der Poel ** Wynndel, British Columbia, CANADA **
EMAIL: bvdpoel at kootenay.com
WWW: http://www.kootenay.com/~bvdpoel
More information about the Python-list
mailing list