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
36239b06
Commit
36239b06
authored
Jun 20, 2018
by
scoder
Committed by
GitHub
Jun 20, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2375 from gabrieldemarmiesse/test_pure_11
Adding tests for "pure python mode" part 11
parents
7a9e41e1
261ac12b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
11 deletions
+13
-11
docs/examples/tutorial/pure/dostuff.pxd
docs/examples/tutorial/pure/dostuff.pxd
+4
-0
docs/examples/tutorial/pure/dostuff.py
docs/examples/tutorial/pure/dostuff.py
+5
-0
docs/src/tutorial/pure.rst
docs/src/tutorial/pure.rst
+4
-11
No files found.
docs/examples/tutorial/pure/dostuff.pxd
0 → 100644
View file @
36239b06
import
cython
@
cython
.
locals
(
t
=
cython
.
int
,
i
=
cython
.
int
)
cpdef
int
dostuff
(
int
n
)
docs/examples/tutorial/pure/dostuff.py
0 → 100644
View file @
36239b06
def
dostuff
(
n
):
t
=
0
for
i
in
range
(
n
):
t
+=
i
return
t
docs/src/tutorial/pure.rst
View file @
36239b06
...
...
@@ -278,20 +278,13 @@ Magic Attributes within the .pxd
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The special `cython` module can also be imported and used within the augmenting
:file:`.pxd` file. For example, the following Python file :file:`dostuff.py`:
:
:file:`.pxd` file. For example, the following Python file :file:`dostuff.py`:
def dostuff(n):
t = 0
for i in range(n):
t += i
return t
.. literalinclude:: ../../examples/tutorial/pure/dostuff.py
can be augmented with the following :file:`.pxd` file :file:`dostuff.pxd`:
:
can be augmented with the following :file:`.pxd` file :file:`dostuff.pxd`:
import cython
@cython.locals(t = cython.int, i = cython.int)
cpdef int dostuff(int n)
.. literalinclude:: ../../examples/tutorial/pure/dostuff.pxd
The :func:`cython.declare()` function can be used to specify types for global
variables in the augmenting :file:`.pxd` file.
...
...
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