[IronPython] Performance of IronPython 2 Beta 4 and IronPython 1
fuzzyman at voidspace.org.uk
Mon Aug 25 09:04:17 PDT 2008
Curt Hagenlocher wrote:
> On Sun, Aug 24, 2008 at 8:23 AM, Dan Eloff <dan.eloff at gmail.com> wrote:
>> A common python optimization is to replace:
>> if key in dict:
>> except KeyError:
>> The reasoning is that the try/except method is faster if no exception
>> is thrown, i.e. you expect the key to be in the dict most of the time.
> It's always irritated me that Python dictionaries don't have the
> equivalent of TryGetValue.
Like the 'get' method?
> Curt Hagenlocher
> curt at hagenlocher.org
> Users mailing list
> Users at lists.ironpython.com
More information about the Users