Commit caa43e47 authored by Stefan Behnel's avatar Stefan Behnel

show how to declare more than one directive

parent da2af6e3
...@@ -398,7 +398,7 @@ Globally ...@@ -398,7 +398,7 @@ Globally
One can set compiler directives through a special header comment at the top of the file, like this:: One can set compiler directives through a special header comment at the top of the file, like this::
#!python #!python
#cython: boundscheck=False #cython: language_level=3, boundscheck=False
The comment must appear before any code (but can appear after other The comment must appear before any code (but can appear after other
comments or whitespace). comments or whitespace).
...@@ -426,7 +426,8 @@ statement, like this:: ...@@ -426,7 +426,8 @@ statement, like this::
@cython.boundscheck(False) # turn off boundscheck for this function @cython.boundscheck(False) # turn off boundscheck for this function
def f(): def f():
... ...
with cython.boundscheck(True): # turn it temporarily on again for this block # turn it temporarily on again for this block
with cython.boundscheck(True):
... ...
.. Warning:: These two methods of setting directives are **not** .. Warning:: These two methods of setting directives are **not**
......
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