Dag Sverre Seljebotn wrote:
>>> 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.
>
> It kind of goes against another idea we've toyed with earlier which is
> auto-generating pxd files from pyx files (perhaps only stuff declared
> "public" or so) so that one doesn't have to edit two seperate files.

Distinct use cases: 1) writing Python code and optionally compiling it to
efficient code, 2) writing Cython code and being lazy about public
declarations. Use case 1) is especially helpful for rapid development,
testing and debugging.


> However it also depends on people not reassigning to the given symbol at
> run-time. I find that this area is a bit unclear at the moment and this
> would make it even less clear (suddenly you shouldn't reassign a
> function with a run-time wrapper because of something in another
> file...)

Sounds like a non-issue to me. If you want optional compilation for speed,
you can well live with some restrictions on those parts of your code that
you specifically declare as C types externally.

Stefan

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

Reply via email to