Testcase for temps in SliceIndexNode
authorDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Mon, 2 Feb 2009 21:48:09 +0000 (22:48 +0100)
committerDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Mon, 2 Feb 2009 21:48:09 +0000 (22:48 +0100)
tests/run/slice2.pyx

index 0cb147c1a0d0d62c6b7319e1c0c85c7673e9a0a7..c4926442aec35be3f6a9769ca5b052c97df276c8 100644 (file)
@@ -16,6 +16,9 @@ __doc__ = u"""
 
     >>> j(1, [1,2,3,4], 2, 3)
     [3]
+
+    >>> slice_of_temporary_smoketest()
+    [3, 2]
 """
 
 def f(obj1, obj2, obj3, obj4):
@@ -33,3 +36,12 @@ def h(obj1, obj2, obj3, obj4):
 def j(obj1, obj2, obj3, obj4):
     obj1 = obj2[obj3:obj4]
     return obj1
+
+class A(object):
+    pass
+
+def slice_of_temporary_smoketest():
+    x = A()
+    x.a = [1, 2]
+    x.a[:] = [3,2]
+    return x.a