== foo.pxd ==
cdef int foo()
== foo.pyx ==
cdef int foo():
print "hi foo"
return 9
== bar.pyx ==
cimport foo
def bar():
print foo.foo()
=============
All good so far.
If I put the above in a regular python package called zap,
and then (from outside of the zap package):
$ python
Python 2.5.1 (r251:54863, Mar 7 2008, 04:10:12)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from zap import bar
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "bar.pyx", line 2, in bar
ImportError: No module named foo
>>>
The C code in bar.c is trying to import module bar.
What is the correct cimport invocation in bar.pyx ?
I tried some obvious permutations ("from zap cimport bar"), but nothing got past
the cython compiler.
Simon.
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev