Ok, I have a working patch, but it keeps failing in lxml in rather
mysterious ways (after fixing your reported bugs)

cdef extern from "lxml.etree_api.h":

    # first function to call!
    cdef int import_lxml__etree() except -1


##########################################################################
    # public ElementTree API classes

    cdef class lxml.etree._Document [ object LxmlDocument ]:
        cdef tree.xmlDoc* _c_doc

    cdef class lxml.etree._Element [ object LxmlElement ]:
        cdef _Document _doc
        cdef tree.xmlNode* _c_node

    cdef class lxml.etree.ElementBase(_Element) [ object LxmlElementBase ]:
        pass

    cdef class lxml.etree._ElementTree [ object LxmlElementTree ]:
        cdef _Document _doc
        cdef _Element  _context_node

    cdef class lxml.etree.ElementClassLookup [ object LxmlElementClassLookup
]:
        cdef object (*_lookup_function)(object, _Document, tree.xmlNode*)

    cdef class lxml.etree.FallbackElementClassLookup(ElementClassLookup) \
             [ object LxmlFallbackElementClassLookup ]:
        cdef ElementClassLookup fallback
        cdef object (*_fallback_function)(object, _Document, tree.xmlNode*)


##########################################################################

Can you elaborate on how exactly this works?  It is by far the most
mysterious code I have ever seen in Cython.

On Sat, Apr 12, 2008 at 6:42 AM, Stefan Behnel <[EMAIL PROTECTED]> wrote:

> Hi,
>
> Gary Furnish wrote:
> > This patch adds extra logic to code generation to sort dependencies to
> > guarantee that C code is generated in the right order for circular cdef
> > imports.
>
> And another issue with the original patch:
>
> https://bugs.launchpad.net/cython/+bug/215550
>
> Stefan
>
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to