Commit 27b8f4ee authored by scoder's avatar scoder Committed by GitHub

Merge pull request #2336 from gabrieldemarmiesse/pure_python_mode_3

Adding tests for "pure python mode" part 3
parents 853e8c6c f5998c80
import cython
if cython.compiled:
print("Yep, I'm compiled.")
else:
print("Just a lowly interpreted script.")
...@@ -109,12 +109,7 @@ modules when Cython is not installed. ...@@ -109,12 +109,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