converts a dictionary object into a list of strings

def _dict_to_string(dictionary):
    '''
    converts a dictionary object into a list of strings
    '''
    ret = ''
    for key, val in sorted(dictionary.items()):
        if isinstance(val, dict):
            for line in _dict_to_string(val):
                ret += six.text_type(key) + '-' + line + '\n'
        elif isinstance(val, list):
            text = ' '.join([six.text_type(item) for item in val])
            ret += six.text_type(key) + ': ' + text + '\n'
        else:
            ret += six.text_type(key) + ': ' + six.text_type(val) + '\n'
    return ret.splitlines()