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