Add corner case temp (de)allocation test. 0.9.9.2.beta
authorRobert Bradshaw <robertwb@math.washington.edu>
Thu, 30 Oct 2008 07:56:21 +0000 (00:56 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Thu, 30 Oct 2008 07:56:21 +0000 (00:56 -0700)
This is as simple as I could get it.

tests/run/temps_corner1.pyx [new file with mode: 0644]

diff --git a/tests/run/temps_corner1.pyx b/tests/run/temps_corner1.pyx
new file mode 100644 (file)
index 0000000..bade962
--- /dev/null
@@ -0,0 +1,18 @@
+__doc__ = """
+   >>> B().coeffs_bitsize()
+   [2]
+"""
+
+cdef class A:
+    def numerator(self):
+        return self
+
+cdef int  bitsize(A a):
+    return 1
+    
+coeffs = [A()]
+
+class B:
+    def coeffs_bitsize(self):
+        r = [bitsize(c.numerator())+1 for c in coeffs]
+        return r