[Cython] [Desired feature] Process .pxd before .py

Alexandru Ionut Grama gramaalexandruionut at gmail.com
Thu Aug 28 20:35:04 CEST 2014


2014-08-28 16:57 GMT+02:00 Stefan Behnel <stefan_ml at behnel.de>:

> Alexandru Ionut Grama schrieb am 26.08.2014 um 17:45:
> > I've start to use cython in order to use call some API modules written in
> > python from C/C++. Those modules written in python must remain untouched,
> > and all .py files should be "decorated" with their counterpart .pxd
> files.
> > I would like to mark as public some API functions from .py files,
> following
> > the indications from http://docs.cython.org/src/tutorial/pxd_files.html.
> > I've started to write a little example:
> >
> > suma_alex.py:
> > def suma_Alex(a,b):
> >         return a+b
> >
> > suma_alex.pxd:
> > cdef public int suma_Alex(int a,int b)
> >
> >
> > The combination of those two files should turn into something like this
> for
> > the compiler:
> >
> > cdef public int suma_Alex(int a,int b):
> >       return a+b
> >
> > On generated .h file I should obtain a function prototype like this:
> > __PYX_EXTERN_C DL_IMPORT(int) suma_Alex(int, int);
> >
> > Instead of that, I obtain a prototype like this:
> > __PYX_EXTERN_C DL_IMPORT(int) __pyx_f_10suma_alex_suma_Alex(int, int);
>
> Looks like a bug to me.

There is a step in the pipeline that merges the
> .pxd file declarations into those found in the main source file. Either the
> "public" modifier is not properly copied over or the cname needs to be
> updated when merging in the override declarations.
>

Hi Stefan,
Thanks for the answer at first.
If is a bug, do you need more information in order to check it? Could you
tell me the methods that are used to merge the override declarations for
investigate by myself and create a patch to correct the bug?

Is there a workaround that maybe solve this?

King regards,
Alexandru



> Stefan
>
> _______________________________________________
> cython-devel mailing list
> cython-devel at python.org
> https://mail.python.org/mailman/listinfo/cython-devel
>



-- 


*---------------------------------------------------------------Alexandru
Ionut Grama**email: gramaalexandruionut at gmail.com
<gramaalexandruionut at gmail.com>*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cython-devel/attachments/20140828/9e64b5af/attachment-0001.html>


More information about the cython-devel mailing list