Commit 44b041c8 authored by scoder's avatar scoder Committed by GitHub

Merge pull request #2372 from gabrieldemarmiesse/test_pure_8

Adding tests for "pure python mode" part 8
parents 5ccb7421 cb13a197
import cython
@cython.locals(a=cython.long, b=cython.long, n=cython.longlong)
def foo(a, b, x, y):
n = a * b
# ...
...@@ -140,12 +140,9 @@ Static typing ...@@ -140,12 +140,9 @@ Static typing
e = cython.declare(cython.int, 5, visibility='readonly') e = cython.declare(cython.int, 5, visibility='readonly')
* ``@cython.locals`` is a decorator that is used to specify the types of local * ``@cython.locals`` is a decorator that is used to specify the types of local
variables in the function body (including the arguments):: variables in the function body (including the arguments):
@cython.locals(a=cython.double, b=cython.double, n=cython.p_double) .. literalinclude:: ../../examples/tutorial/pure/locals.py
def foo(a, b, x, y):
n = a*b
...
* ``@cython.returns(<type>)`` specifies the function's return type. * ``@cython.returns(<type>)`` specifies the function's return type.
......
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