use Py_TYPE() rather than ->ob_type

for python3 support