From: Stefan Behnel Date: Tue, 23 Feb 2010 14:37:40 +0000 (+0100) Subject: extended test case X-Git-Tag: 0.13.beta0~319^2~21 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bdfc9525114f09167898a222b2872dbb9f84fe9d;p=cython.git extended test case --- diff --git a/tests/run/dict_get.pyx b/tests/run/dict_get.pyx index 3aa1b2af..546cbe6b 100644 --- a/tests/run/dict_get.pyx +++ b/tests/run/dict_get.pyx @@ -51,5 +51,16 @@ def get_default(dict d, key, default): 2 >>> get_default(d, 2, 2) 2 + + >>> class Unhashable: + ... def __hash__(self): + ... raise ValueError + + >>> d.get(Unhashable(), 2) + Traceback (most recent call last): + ValueError + >>> get_default(d, Unhashable(), 2) + Traceback (most recent call last): + ValueError """ return d.get(key, default)