def _tostr ( self , obj ) : if not obj : return '' if isinstance ( obj , list ) : return ', ' . join ( map ( self . _tostr , obj ) ) return str ( obj )
python object gets converted to string in list
converts a object to list if object is a list it creates a comma seperated string .
def _tostr(self,obj):
        """ converts a object to list, if object is a list, it creates a
            comma seperated string.
        """
        if not obj:
            return ''
        if isinstance(obj, list):
            return ', '.join(map(self._tostr, obj))
        return str(obj)