From: Robert Bradshaw Date: Tue, 23 Feb 2010 07:55:06 +0000 (-0800) Subject: typo X-Git-Tag: 0.13.beta0~319^2~23 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=98bd96fbd57a94f08e8d4dd9762d8f4f306efa3c;p=cython.git typo --HG-- rename : tests/run/dict_getitme.pyx => tests/run/dict_getitem.pyx --- diff --git a/tests/run/dict_getitme.pyx b/tests/run/dict_getitem.pyx similarity index 58% rename from tests/run/dict_getitme.pyx rename to tests/run/dict_getitem.pyx index 68412f7b..1e063da3 100644 --- a/tests/run/dict_getitme.pyx +++ b/tests/run/dict_getitem.pyx @@ -28,3 +28,25 @@ def test(dict d, index): TypeError: 'NoneType' object is unsubscriptable """ return d[index] + +def time_dict(dict d, ix, long N): + """ + >>> time_dict({"abc": 1}, "abc", 1e6) + """ + from time import time + t = time() + cdef int i + for i in range(N): + d[ix] + return time() - t + +def time_nondict(object d, ix, long N): + """ + >>> time_nondict({"abc": 1}, "abc", 1e6) + """ + from time import time + t = time() + cdef int i + for i in range(N): + d[ix] + return time() - t