Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
27b8f4ee
Commit
27b8f4ee
authored
Jun 15, 2018
by
scoder
Committed by
GitHub
Jun 15, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2336 from gabrieldemarmiesse/pure_python_mode_3
Adding tests for "pure python mode" part 3
parents
853e8c6c
f5998c80
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
docs/examples/tutorial/pure/compiled_switch.py
docs/examples/tutorial/pure/compiled_switch.py
+6
-0
docs/src/tutorial/pure.rst
docs/src/tutorial/pure.rst
+1
-6
No files found.
docs/examples/tutorial/pure/compiled_switch.py
0 → 100644
View file @
27b8f4ee
import
cython
if
cython
.
compiled
:
print
(
"Yep, I'm compiled."
)
else
:
print
(
"Just a lowly interpreted script."
)
docs/src/tutorial/pure.rst
View file @
27b8f4ee
...
@@ -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`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment