Commit 3ba37707 authored by Stefan Behnel's avatar Stefan Behnel

fix signature mismatch in doc example

--HG--
extra : transplant_source : z%C2k%EC%3F%0C%A4%BF%CA1cn%2BY/%3EYI%DB%1F
parent c9729d0d
...@@ -61,7 +61,7 @@ file to be of the declared type. Thus if one has a file :file:`A.py`:: ...@@ -61,7 +61,7 @@ file to be of the declared type. Thus if one has a file :file:`A.py`::
and adds :file:`A.pxd`:: and adds :file:`A.pxd`::
cpdef int myfunction(int x, int y) cpdef int myfunction(int x, int y=*)
cdef double _helper(double a) cdef double _helper(double a)
cdef class A: cdef class A:
...@@ -70,7 +70,7 @@ and adds :file:`A.pxd`:: ...@@ -70,7 +70,7 @@ and adds :file:`A.pxd`::
then Cython will compile the :file:`A.py` as if it had been written as follows:: then Cython will compile the :file:`A.py` as if it had been written as follows::
cpdef int myfunction(int x, int y): cpdef int myfunction(int x, int y=2):
a = x-y a = x-y
return a + x * y return a + x * y
...@@ -89,9 +89,10 @@ then Cython will compile the :file:`A.py` as if it had been written as follows:: ...@@ -89,9 +89,10 @@ then Cython will compile the :file:`A.py` as if it had been written as follows::
Notice how in order to provide the Python wrappers to the definitions Notice how in order to provide the Python wrappers to the definitions
in the :file:`.pxd`, that is, to be accessible from Python, in the :file:`.pxd`, that is, to be accessible from Python,
* Python visible function signatures must be declared as `cpdef`:: * Python visible function signatures must be declared as `cpdef` (with default
arguments replaced by a `*` to avoid repetition)::
cpdef int myfunction(int x, int y) cpdef int myfunction(int x, int y=*)
* C function signatures of internal functions can be declared as `cdef`:: * C function signatures of internal functions can be declared as `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