summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2015-02-20 20:00:12 +0100
committerStefan Behnel <stefan_ml@behnel.de>2015-02-20 20:00:12 +0100
commit3ba37707a5b7d5d62c6cf642b296602a61ce51fa (patch)
tree17051ac80205e46b2eea33a8005f3aa9c0927572
parentc9729d0defec5a051ef2b2675dce8d1c449ffd60 (diff)
downloadcython-3ba37707a5b7d5d62c6cf642b296602a61ce51fa.tar.gz
fix signature mismatch in doc example
--HG-- extra : transplant_source : z%C2k%EC%3F%0C%A4%BF%CA1cn%2BY/%3EYI%DB%1F
-rw-r--r--docs/src/tutorial/pure.rst9
1 files changed, 5 insertions, 4 deletions
diff --git a/docs/src/tutorial/pure.rst b/docs/src/tutorial/pure.rst
index 53535cd6f..c93f5f84e 100644
--- a/docs/src/tutorial/pure.rst
+++ b/docs/src/tutorial/pure.rst
@@ -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`::
- cpdef int myfunction(int x, int y)
+ cpdef int myfunction(int x, int y=*)
cdef double _helper(double a)
cdef class A:
@@ -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::
- cpdef int myfunction(int x, int y):
+ cpdef int myfunction(int x, int y=2):
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::
Notice how in order to provide the Python wrappers to the definitions
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`::