---------- Forwarded message ----------
From: Simon King <[EMAIL PROTECTED]>
Date: Oct 18, 2007 11:49 AM
Subject: cimport of extension classes?
To: sage-newbie <[EMAIL PROTECTED]>



Dear Sage team,

i address this question to "newbie" since it probably has a well known
(but not to me...) answer.

I defined an extension class "Foo" in some module foo.pyx and would
like to cimport it in other modules. Certainly a standard thing to do.

In the "SAGE Programming Guide" (Release 2007.09.26), subsection
5.3.3, it is explained how to make C-level methods callable from a
different Cython module. So, i expected that it works like that for
extension classes as well, and tried
- in foo.pyx:
cdef public class Foo:
    <lots of definitions>
- in foo.pxd:
cdef extern class Foo
- in Module.pyx:
cimport foo
<lots of code referring to foo.Foo>

However, this doesn't work in the faintest.
Running sage -cython foo.pyx yields:
Complaint for foo.pxd: "Module name required for 'extern' C class"
Complaint for foo.pyx: "Object struct name specification required for
'public' C class"
                          and "Type object name specification required
for 'public' C class"

I made various attempts to guess the right syntax, but it didn't work.
Can you help me?

Yours sincerely
         Simon





-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to