Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
1b821f62
Commit
1b821f62
authored
Feb 20, 2015
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix signature mismatch in doc example
parent
3b6ec99c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
docs/src/tutorial/pure.rst
docs/src/tutorial/pure.rst
+5
-4
No files found.
docs/src/tutorial/pure.rst
View file @
1b821f62
...
...
@@ -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`::
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment