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
32ac0752
Commit
32ac0752
authored
Feb 17, 2011
by
W. Trevor King
Committed by
Robert Bradshaw
Feb 17, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
`int` -> `cdef int` when declaring local variables in early binding example.
parent
0b32583c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/userguide/early_binding_for_speed.rst
src/userguide/early_binding_for_speed.rst
+2
-2
No files found.
src/userguide/early_binding_for_speed.rst
View file @
32ac0752
...
@@ -53,7 +53,7 @@ where calls occur within Cython code. For example:
...
@@ -53,7 +53,7 @@ where calls occur within Cython code. For example:
def __init__(self, int x0, int y0, int x1, int y1):
def __init__(self, int x0, int y0, int x1, int y1):
self.x0 = x0; self.y0 = y0; self.x1 = x1; self.y1 = y1
self.x0 = x0; self.y0 = y0; self.x1 = x1; self.y1 = y1
cdef int _area(self):
cdef int _area(self):
int area
cdef
int area
area = (self.x1 - self.x0) * (self.y1 - self.y0)
area = (self.x1 - self.x0) * (self.y1 - self.y0)
if area < 0:
if area < 0:
area = -area
area = -area
...
@@ -88,7 +88,7 @@ overheads. Consider this code:
...
@@ -88,7 +88,7 @@ overheads. Consider this code:
def __init__(self, int x0, int y0, int x1, int y1):
def __init__(self, int x0, int y0, int x1, int y1):
self.x0 = x0; self.y0 = y0; self.x1 = x1; self.y1 = y1
self.x0 = x0; self.y0 = y0; self.x1 = x1; self.y1 = y1
cpdef int area(self):
cpdef int area(self):
int area
cdef
int area
area = (self.x1 - self.x0) * (self.y1 - self.y0)
area = (self.x1 - self.x0) * (self.y1 - self.y0)
if area < 0:
if area < 0:
area = -area
area = -area
...
...
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