In Cython, is there a way to achieve compile time evaluation of a condition? For example something like
def func(bint value):
cdef int i
for i in range(1000000):
# Some stuff is calculated
if value:
# Do something...
else:
# Do something else...
Is there a way to tell Cython to create two versions of the function, one for value==True
and one for value==False
? The evaluation of the if-statement in each loop iteration could have measurable performance costs otherwise.