projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
eace932
)
Test for inplace fix.
author
Robert Bradshaw
<robertwb@math.washington.edu>
Sun, 14 Nov 2010 07:57:49 +0000
(23:57 -0800)
committer
Robert Bradshaw
<robertwb@math.washington.edu>
Sun, 14 Nov 2010 07:57:49 +0000
(23:57 -0800)
tests/run/inplace.pyx
patch
|
blob
|
history
diff --git
a/tests/run/inplace.pyx
b/tests/run/inplace.pyx
index a734913ca55d981aef6673168d94983dabb3a563..a5606f6a0738863f0b9db9d6b199fdedcb671d04 100644
(file)
--- a/
tests/run/inplace.pyx
+++ b/
tests/run/inplace.pyx
@@
-244,3
+244,13
@@
def double_deref_and_increment(o, key1, key2):
v __setitem__ a 11
"""
o[side_effect(key1)][side_effect(key2)] += 1
+
+def conditional_inplace(value, a, condition, b):
+ """
+ >>> conditional_inplace([1, 2, 3], [100], True, [200])
+ [1, 2, 3, 100]
+ >>> conditional_inplace([1, 2, 3], [100], False, [200])
+ [1, 2, 3, 200]
+ """
+ value += a if condition else b
+ return value