Stefan Behnel wrote:
> we've already discussed a couple of times how to provide type information
> for pure Python source code. It was generally agreed that it's difficult
> to do so inside of the function body and easier to do for function
> signatures if we use Py3 annotations. I don't remember any good ideas how
> to provide type information for classes, i.e. how to make them extension
> types.
>
> Now I wonder if it wouldn't be enough to allow .pxd files to override the
> normal "def" and "class" statements in the source (maybe only for .py
> files), so that a "class" that is implemented in the .py file becomes a
> "cdef class" declared in the .pxd file. Same for "def" functions.
>
> We might even be able to handle this completely in the parser, so that the
> rest of the compiler only sees the types as defined in the .pxd file.
> Additionally supporting the "private" modifier in such a .pxd file could
> then turn normal "def" functions into module-local (static) C functions.

I found this now:

http://wiki.cython.org/enhancements/overlaypythonmodules

While it comes close in how it works, it doesn't quite catch the idea
above. Sounds like the proposal needs a little extension.

Stefan

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to