From bdfc9525114f09167898a222b2872dbb9f84fe9d Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Tue, 23 Feb 2010 15:37:40 +0100 Subject: [PATCH] extended test case --- tests/run/dict_get.pyx | 11 +++++++++++ 1 file changed, 11 insertions(+) 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) -- 2.26.2