Commit bdfc9525 authored by Stefan Behnel's avatar Stefan Behnel

extended test case

parent f7effcf5
......@@ -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)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment