[Pyrex] Problems with cimport
Francesc Alted
falted at openlc.org
Wed Nov 12 12:18:31 CET 2003
A Dimecres 12 Novembre 2003 00:41, Greg Ewing va escriure:
> Francesc Alted <falted at openlc.org>:
> > --begin file dishes.pxd--
> > cdef enum otherstuff:
> > sausage, eggs, lettuce
> >
> > cdef struct spamdish:
> > int oz_of_spam
> > otherstuff filler
> > --end file dishes.pxd--
> >
> > --begin file restaurant.pyx--
> > cimport dishes
> >
> > ...
> >
> > d.filler = dishes.sausage
>
> ^^^^^^^^^^^^^^
>
> There is no C entity called 'sausage' defined in dishes.pxd.
Oh, and how can I access to the first item in "otherstuff" enumeration in
dishes.pxd from restaurant.pyx? Is that possible at all? I think this is a C
entity, although I don't know how to reference it.
Please, have in mind that this example has been taken from
http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/version/Doc/sharing.html
--
Francesc Alted
More information about the Pyrex
mailing list