This is given as a comment in Cython - copy constructors .
The following code does not compile in Cython:
def bar(int i): if i == 0: return i else: cdef int j j = i+1 return j
whereas this is absolutely correct:
def foo(int i): cdef int j if i == 0: return i else: j = i+1 return j
Question: why are Sitons forced to declare j at the beginning and not in the else block?
scope cython local
hivert
source share