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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
574c2367
Commit
574c2367
authored
May 10, 2018
by
gabrieldemarmiesse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Corrected some syntax errors.
parent
2a0bcb4e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
docs/src/userguide/language_basics.rst
docs/src/userguide/language_basics.rst
+11
-7
No files found.
docs/src/userguide/language_basics.rst
View file @
574c2367
...
...
@@ -216,15 +216,19 @@ There are differences though whether you declare them in a ``.pyx`` file or a ``
When in a ``.pyx`` file, the signature is the same as it is in Python itself::
from __future__ import print_function
cdef class A:
cdef foo(self):
print "A"
cdef class B(A)
cdef foo(self, x=None)
print "B", x
print("A")
cdef class B(A):
cdef foo(self, x=None):
print("B", x)
cdef class C(B):
cpdef foo(self, x=True, int k=3)
print
"C", x, k
cpdef foo(self, x=True, int k=3)
:
print
("C", x, k)
When in a ``.pxd`` file, the signature is different like this example: ``cdef foo(x=*)``.
...
...
@@ -233,7 +237,7 @@ possible in C, but doesn't need to know the value of the default arguments.::
cdef class A:
cdef foo(self)
cdef class B(A)
cdef class B(A)
:
cdef foo(self, x=*)
cdef class C(B):
cpdef foo(self, x=*, int k=*)
...
...
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