Commit 53366b5f authored by Robert Bradshaw's avatar Robert Bradshaw Committed by GitHub

Merge pull request #1652 from guoci/patch-1

Update language_basics.rst
parents 0558bdb4 bce7cbf7
......@@ -167,9 +167,10 @@ with string attributes if they are to be used after the function returns.
C functions, on the other hand, can have parameters of any type, since they're
passed in directly using a normal C function call.
Functions declared using :keyword:`cdef`, like Python functions, will return a :keyword:`False`
Functions declared using :keyword:`cdef` with Python object return type, like Python functions, will return a :keyword:`None`
value when execution leaves the function body without an explicit return value. This is in
contrast to C/C++, which leaves the return value undefined.
contrast to C/C++, which leaves the return value undefined.
In the case of non-Python object return types, the equivalent of zero is returned, for example, 0 for ``int``, :keyword:`False` for ``bint`` and :keyword:`NULL` for pointer types.
A more complete comparison of the pros and cons of these different method
types can be found at :ref:`early-binding-for-speed`.
......
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