[Cython] [PATCH 2 of 3] Fix cimport example in "Sharing Declarations" section
Kirill Smelkov
kirr at mns.spb.ru
Sat May 3 18:21:36 CEST 2008
# HG changeset patch
# User Kirill Smelkov <kirr at mns.spb.ru>
# Date 1209831534 -14400
# Node ID a81645475dc33f1916f6dc7ee5ec8f52141b20e8
# Parent 0745e2b1f904c2ab8b7c70218d59bd933cbbe3ab
Fix cimport example in "Sharing Declarations" section
- we need to define struct variables with 'cdef'
- there is no -> in Cython/Pyrex
diff --git a/docs/sharing_declarations.rst b/docs/sharing_declarations.rst
--- a/docs/sharing_declarations.rst
+++ b/docs/sharing_declarations.rst
@@ -82,9 +82,9 @@ uses it.
d.filler = dishes.sausage
def serve():
- spamdish d
+ cdef spamdish d
prepare(&d)
- print "%d oz spam, filler no. %d" % (d->oz_of_spam, d->otherstuff)
+ print "%d oz spam, filler no. %d" % (d.oz_of_spam, d.otherstuff)
It is important to understand that the :keyword:`cimport` statement can only
be used to import C data types, C functions and variables, and extension
More information about the Cython-dev
mailing list