OK -- that shows the option:
# Allows cimporting from a pyx file without a pxd file.
cimport_from_pyx = False
Which looks like a great idea. However:
1) how do you change that option -- treating it like compiler
directive, either with:
#cython: cimport_from_pyx=False
or passing it in on the comamnd line:
cython --cplus -X cimport_from_pyx=True multi_rectangle.pyx
did not work.
So I changed it in the Options.py file directly. But I'd rather not
make that a global change!
After that, Cython now gets psat the cipmport statement, no longer
with the error tha the *.pxd can not be found. But it doesn't seem to
work either.
I borrowed an example from the Wiki, and am adding to it, so in
rectangle.pyx, I have:
cdef class Rectangle:
cdef c_Rectangle *thisptr # hold a C++ instance which we're wrapping
def __cinit__(self, int x0, int y0, int x1, int y1):
self.thisptr = new_Rectangle(x0, y0, x1, y1)
....
(and so on)
Then in multi_rectangle.pyx, I put:
from rectangle cimport Rectangle
...
def addRect(self, Rectangle rect):
"""
add a rectangle object -- this will only take a rectangle object
"""
self.rectangles.append(rect)
...
But I get:
def addRect(self, Rectangle rect):
^
------------------------------------------------------------
multi_rectangle.pyx:24:22: 'Rectangle' is not a type identifier
so something isn't working.
I've enclosed the whole package if anyone wants to take a look.