Copy-paste of original python in Cython