In Cython, declaring a variable as int gives it a native C type in the generated implementation; without that declaration, the implementation handles it as a Python object. The Python-facing wrapper remains object-based and converts values when calling the typed implementation. section 5.2.3
#cython: language_level=3
def add4(my_number):
i = my_number + 4
return i
def add4_annotated(int my_number):
cdef int i
i = my_number + 4
return i
Compare add4 with add4_annotated to see how declaring int changes the implementation’s parameter and local variable types. section 5.2.3
