Commit f5998c80 authored by gabrieldemarmiesse's avatar gabrieldemarmiesse

Moved the compiled switch code snippet to the examples directory for testing.

parent 5fadf79e
import cython
if cython.compiled:
print("Yep, I'm compiled.")
else:
print("Just a lowly interpreted script.")
......@@ -141,12 +141,7 @@ modules when Cython is not installed.
* ``compiled`` is a special variable which is set to ``True`` when the compiler
runs, and ``False`` in the interpreter. Thus, the code
::
if cython.compiled:
print("Yep, I'm compiled.")
else:
print("Just a lowly interpreted script.")
.. literalinclude:: ../../examples/tutorial/pure/compiled_switch.py
will behave differently depending on whether or not the code is executed as a
compiled extension (:file:`.so`/:file:`.pyd`) module or a plain :file:`.py`
......
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