if statement for python 2 basestring to str in python 3 is at top of cython file