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
Gwenaël Samain
cython
Commits
6d343f58
Commit
6d343f58
authored
Feb 01, 2013
by
Yury V. Zaytsev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix broken code samples (indent, spaces, failing doctest)
parent
6436c7d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
docs/src/tutorial/cdef_classes.rst
docs/src/tutorial/cdef_classes.rst
+6
-6
docs/src/tutorial/clibraries.rst
docs/src/tutorial/clibraries.rst
+1
-1
No files found.
docs/src/tutorial/cdef_classes.rst
View file @
6d343f58
...
...
@@ -37,14 +37,14 @@ function on floating point numbers::
cdef class Function:
cpdef double evaluate(self, double x) except *:
return 0
return 0
Like before, cpdef makes two versions of the method available; one
fast for use from Cython and one slower for use from Python. Then::
cdef class SinOfSquareFunction(Function):
cpdef double evaluate(self, double x) except *:
return sin(x**2)
return sin(x**2)
Using this, we can now change our integration example::
...
...
@@ -134,8 +134,8 @@ Attributes in cdef classes behave differently from attributes in regular classes
cdef public double freq
# Available in Python-space:
property period:
def __get__(self):
return 1.0 / self.
freq
def __set__(self, value):
self.
freq = 1.0 / value
def __get__(self):
return 1.0 / self.freq
def __set__(self, value):
self.freq = 1.0 / value
<...>
docs/src/tutorial/clibraries.rst
View file @
6d343f58
...
...
@@ -440,7 +440,7 @@ The following listing shows the complete implementation that uses
raise IndexError("Queue is empty")
return value
cdef int pop(self) except? -1:
c
p
def int pop(self) except? -1:
if cqueue.queue_is_empty(self._c_queue):
raise IndexError("Queue is empty")
return <int>cqueue.queue_pop_head(self._c_queue)
...
...
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