cython-devel

changeset 1289:82084a7b654e 0.9.9.2.beta

Add corner case temp (de)allocation test.

This is as simple as I could get it.
author Robert Bradshaw <robertwb@math.washington.edu>
date Thu Oct 30 00:56:21 2008 -0700 (4 years ago)
parents 1f1a398eda71
children 1bf68613f2b4de1fb76a62a7
files tests/run/temps_corner1.pyx
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/tests/run/temps_corner1.pyx Thu Oct 30 00:56:21 2008 -0700 1.3 @@ -0,0 +1,18 @@ 1.4 +__doc__ = """ 1.5 + >>> B().coeffs_bitsize() 1.6 + [2] 1.7 +""" 1.8 + 1.9 +cdef class A: 1.10 + def numerator(self): 1.11 + return self 1.12 + 1.13 +cdef int bitsize(A a): 1.14 + return 1 1.15 + 1.16 +coeffs = [A()] 1.17 + 1.18 +class B: 1.19 + def coeffs_bitsize(self): 1.20 + r = [bitsize(c.numerator())+1 for c in coeffs] 1.21 + return r