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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
261ac12b
Commit
261ac12b
authored
Jun 18, 2018
by
gabrieldemarmiesse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved the dostuff.py example to the examples directory.
parent
5c04c1a8
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 @
261ac12b
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 @
261ac12b
def
dostuff
(
n
):
t
=
0
for
i
in
range
(
n
):
t
+=
i
return
t
docs/src/tutorial/pure.rst
View file @
261ac12b
...
...
@@ -288,20 +288,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