Commit 0d666f3b authored by gabrieldemarmiesse's avatar gabrieldemarmiesse

Moved an example of the language basics into the examples directory.

parent 084a25f5
from __future__ import print_function
cdef:
struct Spam:
int tons
int i
float a
Spam *p
void f(Spam *s):
print(s.tons, "Tons of spam")
...@@ -179,20 +179,9 @@ Grouping multiple C declarations ...@@ -179,20 +179,9 @@ Grouping multiple C declarations
-------------------------------- --------------------------------
If you have a series of declarations that all begin with :keyword:`cdef`, you If you have a series of declarations that all begin with :keyword:`cdef`, you
can group them into a :keyword:`cdef` block like this:: can group them into a :keyword:`cdef` block like this:
from __future__ import print_function .. literalinclude:: ../../examples/userguide/language_basics/cdef_block.pyx
cdef:
struct Spam:
int tons
int i
float a
Spam *p
void f(Spam *s):
print(s.tons, "Tons of spam")
.. _cpdef: .. _cpdef:
.. _cdef: .. _cdef:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment