[Pyrex] [Cython-dev] Test case for Pyrex and Cython
Jim Kleckner
jek-gmane at kleckner.net
Tue Nov 27 00:53:28 CET 2007
Greg Ewing wrote:
> On Sun, 2007-11-25 at 14:14 -0800, Jim Kleckner wrote:
>
>> I do prefer using fully-qualified names inside the pyx
>> files.
>
> You should be able to do that in any case -- the rules for
> naming modules in a cimport statement are supposed to be
> the same as for an import statement in Python.
>
> Are you saying that using full module names doesn't work
> for some reason in Pyrex/Cython/both? I'm getting a bit
> confused as to which system is being talked about.
You are right, of course. But in order to make it possible
to refer to other modules by their fully-qualified names
from within the current package using Cython, I had to
implement David's package hierarchy precisely. Part of it
is moving the setup.py file up one directory. This is not
necessary if you are using Pyrex.
I took David's rework and created a new zip file with the
examples. It contains two directories, "WorksWithCython"
that shows the layout for Cython and "WorksWithPyrex" which
shows how files must be named for Pyrex.
The zip file is attached to this page:
http://wiki.cython.org/PackageHierarchy
Go the the bottom of the page or click attachments.
They are not compatible. It would be nice if they were
more compatible.
This could be done either by Pyrex permitting naming
of the form package/module.pyx (instead of requiring
the form package/package.module.pyx) or by Cython
permitting the form package/package.module.pyx.
The former makes a lot more sense as David points out.
More information about the Pyrex
mailing list