From: Robert Bradshaw Date: Tue, 14 Jul 2009 07:09:58 +0000 (-0700) Subject: del item test X-Git-Tag: 0.12.alpha0~224^2~1^2^2~11 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e26d9aacfc467e3e78b42c7111296524f4c4071a;p=cython.git del item test --- 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