From f77dce8a5dda13c759faeabb892d5f439dc05fd5 Mon Sep 17 00:00:00 2001 From: John R. Lenton Date: Mon, 6 Jan 2014 20:08:52 +0000 Subject: Added dict.popitem --- tests/basics/tests/dict_popitem.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/basics/tests/dict_popitem.py (limited to 'tests') diff --git a/tests/basics/tests/dict_popitem.py b/tests/basics/tests/dict_popitem.py new file mode 100644 index 000000000..184735cde --- /dev/null +++ b/tests/basics/tests/dict_popitem.py @@ -0,0 +1,11 @@ +d={1:2,3:4} +print(d.popitem()) +print(d) +print(d.popitem()) +print(d) +try: + print(d.popitem(), "!!!",) +except KeyError: + print("Raised KeyError") +else: + print("Did not raise KeyError") -- cgit v1.2.3