Dag Sverre Seljebotn, 23.02.2010 12:30:
> Stefan Behnel wrote:
>>     cdef dict d = ...
>>     try:
>>         item = d['test']
>>     except KeyError:
>>         item = d['test'] = some_value
>
> How about just optimizing "d.get(key[, default])" if it isn't already 
> for this case, and document that [] is slower?

Very good idea. I'll do that.

Stefan

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to