What I want to do - transform my pure Python code into Cython.
Pure Python code:
def conflicts(list1,list2): numIt = 10 for i in list1: for j in list2: if i == j and i < numIt: return True return False conflicts([1,2,3], [6,9,8])
My Cython code so far:
cdef char conflicts(int  list1,int  list2): cdef int numIt = 10 for i in list1: for j in list2: if i == j and i < numIt: return True return False conflicts([1,2,3], [6,9,8])
Since I am completely new to Cython (and not really a pro in Python) I would like to get some feedback about my transformation. Am I doing the right thing? Is there anything else I should do in order to make the function even faster?
Does anyone know how i can add types in the header of the function for the input (list1, list2)? I tried "int [:]" which compiles without error but when i try to call the function with two lists i get the message "TypeError: 'list' does not have the buffer interface".