From: Dag Sverre Seljebotn Date: Wed, 6 May 2009 18:46:36 +0000 (+0200) Subject: Testcases for #303 X-Git-Tag: 0.11.2.rc1~10^2~31 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a7f25564bd8e438797c87751f02cced63fea494a;p=cython.git Testcases for #303 --- diff --git a/tests/run/external_defs.h b/tests/run/external_defs.h new file mode 100644 index 00000000..a6f22cf0 --- /dev/null +++ b/tests/run/external_defs.h @@ -0,0 +1,3 @@ + + +typedef double DoubleTypedef; diff --git a/tests/run/typedfieldbug_T303.pyx b/tests/run/typedfieldbug_T303.pyx new file mode 100644 index 00000000..5db65860 --- /dev/null +++ b/tests/run/typedfieldbug_T303.pyx @@ -0,0 +1,20 @@ +""" +>>> f() +42.0 42.0 +""" + +cdef extern from "external_defs.h": + ctypedef float DoubleTypedef + +cdef class MyClass: + cdef readonly: + double var_d + DoubleTypedef var_nf + def __init__(self): + self.var_d = 42.0 + self.var_nf = 42.0 + +def f(): + c = MyClass() + print c.var_d, c.var_nf +