cython: add 'from cpython.version cimport PY_VERSION' example in playground.

This test the latest improvement of the regex in cython extra.
This commit is contained in:
Nicolas Pauss 2018-11-27 15:21:22 +01:00 committed by Romain Le Godais
parent b367410172
commit dede827db2
4 changed files with 264 additions and 40 deletions

View File

@ -951,6 +951,16 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
static void __Pyx_AddTraceback(const char *funcname, int c_line,
int py_line, const char *filename);
/* Print.proto */
static int __Pyx_Print(PyObject*, PyObject *, int);
#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3
static PyObject* __pyx_print = 0;
static PyObject* __pyx_print_kwargs = 0;
#endif
/* PrintOne.proto */
static int __Pyx_PrintOne(PyObject* stream, PyObject *o);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
@ -980,35 +990,46 @@ static int __Pyx_check_binary_version(void);
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
/* Module declarations from 'cpython.version' */
/* Module declarations from 'cy_ctest' */
#define __Pyx_MODULE_NAME "cy_ctest"
extern int __pyx_module_is_main_cy_ctest;
int __pyx_module_is_main_cy_ctest = 0;
/* Implementation of 'cy_ctest' */
static const char __pyx_k_end[] = "end";
static const char __pyx_k_file[] = "file";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_name[] = "__name__";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_print[] = "print";
static const char __pyx_k_pyhello[] = "pyhello";
static const char __pyx_k_cy_ctest[] = "cy_ctest";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_Compiled_with_python_version_s[] = "Compiled with python version %s";
static const char __pyx_k_home_romain_dev_waf_wrapper_waf[] = "/home/romain/dev/waf-wrapper/waf/playground/cython/src/cy_ctest.pyx";
static PyObject *__pyx_kp_s_Compiled_with_python_version_s;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_cy_ctest;
static PyObject *__pyx_n_s_end;
static PyObject *__pyx_n_s_file;
static PyObject *__pyx_kp_s_home_romain_dev_waf_wrapper_waf;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_print;
static PyObject *__pyx_n_s_pyhello;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_pf_8cy_ctest_pyhello(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_codeobj_;
/* Late includes */
/* "cy_ctest.pyx":3
* cimport cy_ctest
/* "cy_ctest.pyx":5
* #cimport commented_import
*
* def pyhello(): # <<<<<<<<<<<<<<
* cy_ctest.hello()
* print("Compiled with python version %s" % PY_VERSION)
*/
/* Python wrapper */
@ -1028,24 +1049,48 @@ static PyObject *__pyx_pw_8cy_ctest_1pyhello(PyObject *__pyx_self, CYTHON_UNUSED
static PyObject *__pyx_pf_8cy_ctest_pyhello(CYTHON_UNUSED PyObject *__pyx_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("pyhello", 0);
/* "cy_ctest.pyx":4
/* "cy_ctest.pyx":6
*
* def pyhello():
* cy_ctest.hello() # <<<<<<<<<<<<<<
* print("Compiled with python version %s" % PY_VERSION)
*/
hello();
/* "cy_ctest.pyx":3
* cimport cy_ctest
/* "cy_ctest.pyx":7
* def pyhello():
* cy_ctest.hello()
* print("Compiled with python version %s" % PY_VERSION) # <<<<<<<<<<<<<<
*/
__pyx_t_1 = __Pyx_PyObject_FromString(PY_VERSION); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Compiled_with_python_version_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__Pyx_PrintOne(0, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "cy_ctest.pyx":5
* #cimport commented_import
*
* def pyhello(): # <<<<<<<<<<<<<<
* cy_ctest.hello()
* print("Compiled with python version %s" % PY_VERSION)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("cy_ctest.pyhello", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
@ -1097,11 +1142,15 @@ static struct PyModuleDef __pyx_moduledef = {
#endif
static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_kp_s_Compiled_with_python_version_s, __pyx_k_Compiled_with_python_version_s, sizeof(__pyx_k_Compiled_with_python_version_s), 0, 0, 1, 0},
{&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
{&__pyx_n_s_cy_ctest, __pyx_k_cy_ctest, sizeof(__pyx_k_cy_ctest), 0, 0, 1, 1},
{&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
{&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
{&__pyx_kp_s_home_romain_dev_waf_wrapper_waf, __pyx_k_home_romain_dev_waf_wrapper_waf, sizeof(__pyx_k_home_romain_dev_waf_wrapper_waf), 0, 0, 1, 0},
{&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
{&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
{&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
{&__pyx_n_s_pyhello, __pyx_k_pyhello, sizeof(__pyx_k_pyhello), 0, 0, 1, 1},
{&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
{0, 0, 0, 0, 0, 0, 0}
@ -1114,13 +1163,14 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
/* "cy_ctest.pyx":3
* cimport cy_ctest
/* "cy_ctest.pyx":5
* #cimport commented_import
*
* def pyhello(): # <<<<<<<<<<<<<<
* cy_ctest.hello()
* print("Compiled with python version %s" % PY_VERSION)
*/
__pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_romain_dev_waf_wrapper_waf, __pyx_n_s_pyhello, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 3, __pyx_L1_error)
__pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_romain_dev_waf_wrapper_waf, __pyx_n_s_pyhello, 5, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 5, __pyx_L1_error)
__Pyx_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
@ -1395,21 +1445,22 @@ if (!__Pyx_RefNanny) {
if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
/* "cy_ctest.pyx":3
* cimport cy_ctest
/* "cy_ctest.pyx":5
* #cimport commented_import
*
* def pyhello(): # <<<<<<<<<<<<<<
* cy_ctest.hello()
* print("Compiled with python version %s" % PY_VERSION)
*/
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8cy_ctest_1pyhello, NULL, __pyx_n_s_cy_ctest); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8cy_ctest_1pyhello, NULL, __pyx_n_s_cy_ctest); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyhello, __pyx_t_1) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyhello, __pyx_t_1) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "cy_ctest.pyx":1
* cimport cy_ctest # <<<<<<<<<<<<<<
*
* def pyhello():
* from cpython.version cimport PY_VERSION # <<<<<<<<<<<<<<
* cimport cy_ctest
* #cimport commented_import
*/
__pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
@ -1703,6 +1754,149 @@ bad:
Py_XDECREF(py_frame);
}
/* Print */
#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
static PyObject *__Pyx_GetStdout(void) {
PyObject *f = PySys_GetObject((char *)"stdout");
if (!f) {
PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
}
return f;
}
static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
int i;
if (!f) {
if (!(f = __Pyx_GetStdout()))
return -1;
}
Py_INCREF(f);
for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
PyObject* v;
if (PyFile_SoftSpace(f, 1)) {
if (PyFile_WriteString(" ", f) < 0)
goto error;
}
v = PyTuple_GET_ITEM(arg_tuple, i);
if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
goto error;
if (PyString_Check(v)) {
char *s = PyString_AsString(v);
Py_ssize_t len = PyString_Size(v);
if (len > 0) {
switch (s[len-1]) {
case ' ': break;
case '\f': case '\r': case '\n': case '\t': case '\v':
PyFile_SoftSpace(f, 0);
break;
default: break;
}
}
}
}
if (newline) {
if (PyFile_WriteString("\n", f) < 0)
goto error;
PyFile_SoftSpace(f, 0);
}
Py_DECREF(f);
return 0;
error:
Py_DECREF(f);
return -1;
}
#else
static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
PyObject* kwargs = 0;
PyObject* result = 0;
PyObject* end_string;
if (unlikely(!__pyx_print)) {
__pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print);
if (!__pyx_print)
return -1;
}
if (stream) {
kwargs = PyDict_New();
if (unlikely(!kwargs))
return -1;
if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0))
goto bad;
if (!newline) {
end_string = PyUnicode_FromStringAndSize(" ", 1);
if (unlikely(!end_string))
goto bad;
if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) {
Py_DECREF(end_string);
goto bad;
}
Py_DECREF(end_string);
}
} else if (!newline) {
if (unlikely(!__pyx_print_kwargs)) {
__pyx_print_kwargs = PyDict_New();
if (unlikely(!__pyx_print_kwargs))
return -1;
end_string = PyUnicode_FromStringAndSize(" ", 1);
if (unlikely(!end_string))
return -1;
if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) {
Py_DECREF(end_string);
return -1;
}
Py_DECREF(end_string);
}
kwargs = __pyx_print_kwargs;
}
result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
Py_DECREF(kwargs);
if (!result)
return -1;
Py_DECREF(result);
return 0;
bad:
if (kwargs != __pyx_print_kwargs)
Py_XDECREF(kwargs);
return -1;
}
#endif
/* PrintOne */
#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
if (!f) {
if (!(f = __Pyx_GetStdout()))
return -1;
}
Py_INCREF(f);
if (PyFile_SoftSpace(f, 0)) {
if (PyFile_WriteString(" ", f) < 0)
goto error;
}
if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
goto error;
if (PyFile_WriteString("\n", f) < 0)
goto error;
Py_DECREF(f);
return 0;
error:
Py_DECREF(f);
return -1;
/* the line below is just to avoid C compiler
* warnings about unused functions */
return __Pyx_Print(f, NULL, 0);
}
#else
static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
int res;
PyObject* arg_tuple = PyTuple_Pack(1, o);
if (unlikely(!arg_tuple))
return -1;
res = __Pyx_Print(stream, arg_tuple, 1);
Py_DECREF(arg_tuple);
return res;
}
#endif
/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;

View File

@ -1012,6 +1012,8 @@ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *s
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
/* Module declarations from 'cpython.version' */
/* Module declarations from 'cy_cxxtest' */
__PYX_EXTERN_C void cy_hello(void); /*proto*/
#define __Pyx_MODULE_NAME "cy_cxxtest"
@ -1029,7 +1031,9 @@ static const char __pyx_k_pyhello[] = "pyhello";
static const char __pyx_k_cy_cxxtest[] = "cy_cxxtest";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_hello_cython_world[] = "hello cython-world!";
static const char __pyx_k_Compiled_with_python_version_s[] = "Compiled with python version %s";
static const char __pyx_k_home_romain_dev_waf_wrapper_waf[] = "/home/romain/dev/waf-wrapper/waf/playground/cython/src/cy_cxxtest.pyx";
static PyObject *__pyx_kp_s_Compiled_with_python_version_s;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_cy_cxxtest;
static PyObject *__pyx_n_s_end;
@ -1045,12 +1049,12 @@ static PyObject *__pyx_pf_10cy_cxxtest_pyhello(CYTHON_UNUSED PyObject *__pyx_sel
static PyObject *__pyx_codeobj_;
/* Late includes */
/* "cy_cxxtest.pyx":3
/* "cy_cxxtest.pyx":4
* cimport cy_cxxtest
*
* def pyhello(): # <<<<<<<<<<<<<<
* cy_cxxtest.hello()
*
* print("Compiled with python version %s" % PY_VERSION)
*/
/* Python wrapper */
@ -1070,58 +1074,79 @@ static PyObject *__pyx_pw_10cy_cxxtest_1pyhello(PyObject *__pyx_self, CYTHON_UNU
static PyObject *__pyx_pf_10cy_cxxtest_pyhello(CYTHON_UNUSED PyObject *__pyx_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
__Pyx_RefNannySetupContext("pyhello", 0);
/* "cy_cxxtest.pyx":4
/* "cy_cxxtest.pyx":5
*
* def pyhello():
* cy_cxxtest.hello() # <<<<<<<<<<<<<<
* print("Compiled with python version %s" % PY_VERSION)
*
* cdef public api void cy_hello():
*/
hello();
/* "cy_cxxtest.pyx":3
/* "cy_cxxtest.pyx":6
* def pyhello():
* cy_cxxtest.hello()
* print("Compiled with python version %s" % PY_VERSION) # <<<<<<<<<<<<<<
*
* cdef public api void cy_hello():
*/
__pyx_t_1 = __Pyx_PyObject_FromString(PY_VERSION); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Compiled_with_python_version_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__Pyx_PrintOne(0, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "cy_cxxtest.pyx":4
* cimport cy_cxxtest
*
* def pyhello(): # <<<<<<<<<<<<<<
* cy_cxxtest.hello()
*
* print("Compiled with python version %s" % PY_VERSION)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("cy_cxxtest.pyhello", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "cy_cxxtest.pyx":6
* cy_cxxtest.hello()
/* "cy_cxxtest.pyx":8
* print("Compiled with python version %s" % PY_VERSION)
*
* cdef public api void cy_hello(): # <<<<<<<<<<<<<<
* print("hello cython-world!")
*
*/
void cy_hello(void) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("cy_hello", 0);
/* "cy_cxxtest.pyx":7
/* "cy_cxxtest.pyx":9
*
* cdef public api void cy_hello():
* print("hello cython-world!") # <<<<<<<<<<<<<<
*
*/
if (__Pyx_PrintOne(0, __pyx_kp_s_hello_cython_world) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
if (__Pyx_PrintOne(0, __pyx_kp_s_hello_cython_world) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
/* "cy_cxxtest.pyx":6
* cy_cxxtest.hello()
/* "cy_cxxtest.pyx":8
* print("Compiled with python version %s" % PY_VERSION)
*
* cdef public api void cy_hello(): # <<<<<<<<<<<<<<
* print("hello cython-world!")
*
*/
/* function exit code */
@ -1178,6 +1203,7 @@ static struct PyModuleDef __pyx_moduledef = {
#endif
static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_kp_s_Compiled_with_python_version_s, __pyx_k_Compiled_with_python_version_s, sizeof(__pyx_k_Compiled_with_python_version_s), 0, 0, 1, 0},
{&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
{&__pyx_n_s_cy_cxxtest, __pyx_k_cy_cxxtest, sizeof(__pyx_k_cy_cxxtest), 0, 0, 1, 1},
{&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
@ -1199,14 +1225,14 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
/* "cy_cxxtest.pyx":3
/* "cy_cxxtest.pyx":4
* cimport cy_cxxtest
*
* def pyhello(): # <<<<<<<<<<<<<<
* cy_cxxtest.hello()
*
* print("Compiled with python version %s" % PY_VERSION)
*/
__pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_romain_dev_waf_wrapper_waf, __pyx_n_s_pyhello, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 3, __pyx_L1_error)
__pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_romain_dev_waf_wrapper_waf, __pyx_n_s_pyhello, 4, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 4, __pyx_L1_error)
__Pyx_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
@ -1485,22 +1511,22 @@ if (!__Pyx_RefNanny) {
if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
/* "cy_cxxtest.pyx":3
/* "cy_cxxtest.pyx":4
* cimport cy_cxxtest
*
* def pyhello(): # <<<<<<<<<<<<<<
* cy_cxxtest.hello()
*
* print("Compiled with python version %s" % PY_VERSION)
*/
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10cy_cxxtest_1pyhello, NULL, __pyx_n_s_cy_cxxtest); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)
__pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10cy_cxxtest_1pyhello, NULL, __pyx_n_s_cy_cxxtest); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyhello, __pyx_t_1) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyhello, __pyx_t_1) < 0) __PYX_ERR(0, 4, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "cy_cxxtest.pyx":1
* cimport cy_cxxtest # <<<<<<<<<<<<<<
* from cpython.version cimport PY_VERSION # <<<<<<<<<<<<<<
* cimport cy_cxxtest
*
* def pyhello():
*/
__pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);

View File

@ -1,4 +1,7 @@
from cpython.version cimport PY_VERSION
cimport cy_ctest
#cimport commented_import
def pyhello():
cy_ctest.hello()
print("Compiled with python version %s" % PY_VERSION)

View File

@ -1,8 +1,9 @@
from cpython.version cimport PY_VERSION
cimport cy_cxxtest
def pyhello():
cy_cxxtest.hello()
print("Compiled with python version %s" % PY_VERSION)
cdef public api void cy_hello():
print("hello cython-world!")