str => basestring, py2/3 compatibility