Commit 9bac8a99 authored by Matus Valo's avatar Matus Valo Committed by GitHub

docs: Fix langage_basics example after enabling '-> object' as return type declaration (GH-4497)

See https://github.com/cython/cython/issues/2529
parent 5b325c98
......@@ -477,13 +477,24 @@ as the name of a type, for example,
...
declares a parameter called ``int`` which is a Python object. You can also use
object as the explicit return type of a function, e.g.::
object as the explicit return type of a function, e.g.
cdef object ftang(object int):
...
.. tabs::
.. group-tab:: Pure Python
.. code-block:: python
@cython.cfunc
def ftang(int: object) -> object:
...
.. group-tab:: Cython
.. note:: Currently, Cython contains a bug not allowing ``object`` as return annotation in
pure Python from a C function. (GitHub issue :issue:`2529`)
.. code-block:: cython
cdef object ftang(object int):
...
In the interests of clarity, it is probably a good idea to always be explicit
about object parameters in C functions.
......
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