projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a86eb38
)
del item test
author
Robert Bradshaw
<robertwb@math.washington.edu>
Tue, 14 Jul 2009 07:09:58 +0000
(
00:09
-0700)
committer
Robert Bradshaw
<robertwb@math.washington.edu>
Tue, 14 Jul 2009 07:09:58 +0000
(
00:09
-0700)
tests/run/delete.pyx
patch
|
blob
|
history
diff --git
a/tests/run/delete.pyx
b/tests/run/delete.pyx
index 961967455340bd9e2aaffa520e8f89fbd1ae5f7b..50c410362c9aa780ba99741cf08f20299f26c18a 100644
(file)
--- 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