obj2str for python