From e26d9aacfc467e3e78b42c7111296524f4c4071a Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Tue, 14 Jul 2009 00:09:58 -0700 Subject: [PATCH] del item test --- tests/run/delete.pyx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/run/delete.pyx b/tests/run/delete.pyx index 96196745..50c41036 100644 --- a/tests/run/delete.pyx +++ b/tests/run/delete.pyx @@ -4,6 +4,10 @@ [2, 1] >>> a.g() (False, True) +>>> del_item({1: 'a', 2: 'b'}, 1) +{2: 'b'} +>>> del_item(range(10), 2) +[0, 1, 3, 4, 5, 6, 7, 8, 9] """ class A: @@ -16,3 +20,7 @@ class A: self.a = 3 del self.a return (hasattr(self, u"a"), hasattr(self, u"g")) + +def del_item(L, o): + del L[o] + return L -- 2.26.2