Commit 574c2367 authored by gabrieldemarmiesse's avatar gabrieldemarmiesse

Corrected some syntax errors.

parent 2a0bcb4e
...@@ -216,15 +216,19 @@ There are differences though whether you declare them in a ``.pyx`` file or a `` ...@@ -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:: 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 class A:
cdef foo(self): cdef foo(self):
print "A" print("A")
cdef class B(A)
cdef foo(self, x=None) cdef class B(A):
print "B", x cdef foo(self, x=None):
print("B", x)
cdef class C(B): cdef class C(B):
cpdef foo(self, x=True, int k=3) cpdef foo(self, x=True, int k=3):
print "C", x, k print("C", x, k)
When in a ``.pxd`` file, the signature is different like this example: ``cdef foo(x=*)``. 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.:: ...@@ -233,7 +237,7 @@ possible in C, but doesn't need to know the value of the default arguments.::
cdef class A: cdef class A:
cdef foo(self) cdef foo(self)
cdef class B(A) cdef class B(A):
cdef foo(self, x=*) cdef foo(self, x=*)
cdef class C(B): cdef class C(B):
cpdef foo(self, x=*, int k=*) cpdef foo(self, x=*, int k=*)
......
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