Generally yes. Of course, there are errors (many revolve around the extension of the supported subset of Python, although the errors that actually make the generated C code wrong are relatively rare), and there are several necessary caveats (although it seems that only one element in this short list is distracted from semantics Python).
When you add static types in pure Python mode, there are circumstances in which it matters whether it is compiled as Cython or executed as Python code. Fixed integers come to mind (for example: as mentioned in one link above, -n will wrap if unsigned n and range(-n, n) are therefore empty), as well as integer overflow (Python advances int (C long s) to long (integers of refractive accuracy)).
delnan
source share