From: Robert Bradshaw Date: Thu, 30 Oct 2008 07:56:21 +0000 (-0700) Subject: Add corner case temp (de)allocation test. X-Git-Tag: 0.9.9.2.beta X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9ca8c125c2e575a7d7cf1c22b5f909f322228468;p=cython.git Add corner case temp (de)allocation test. This is as simple as I could get it. --- diff --git a/tests/run/temps_corner1.pyx b/tests/run/temps_corner1.pyx new file mode 100644 index 00000000..bade9629 --- /dev/null +++ b/tests/run/temps_corner1.pyx @@ -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