From: W. Trevor King Date: Thu, 17 Feb 2011 12:57:11 +0000 (-0500) Subject: `int` -> `cdef int` when declaring local variables in early binding example. X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=32ac0752bdf60a7ecfdfaea07f26e68060529486;p=cython.git `int` -> `cdef int` when declaring local variables in early binding example. --- diff --git a/src/userguide/early_binding_for_speed.rst b/src/userguide/early_binding_for_speed.rst index 07e0047a..d44498dd 100644 --- a/src/userguide/early_binding_for_speed.rst +++ b/src/userguide/early_binding_for_speed.rst @@ -53,7 +53,7 @@ where calls occur within Cython code. For example: def __init__(self, int x0, int y0, int x1, int y1): self.x0 = x0; self.y0 = y0; self.x1 = x1; self.y1 = y1 cdef int _area(self): - int area + cdef int area area = (self.x1 - self.x0) * (self.y1 - self.y0) if area < 0: area = -area @@ -88,7 +88,7 @@ overheads. Consider this code: def __init__(self, int x0, int y0, int x1, int y1): self.x0 = x0; self.y0 = y0; self.x1 = x1; self.y1 = y1 cpdef int area(self): - int area + cdef int area area = (self.x1 - self.x0) * (self.y1 - self.y0) if area < 0: area = -area