python: cython support - thanks to Tan Sheng Di for helps