def sub_list(l):
r = []<EOL>for i in l:<EOL><INDENT>if type(i) in prims:<EOL><INDENT>r.append(i)<EOL><DEDENT>elif type(i) is list:<EOL><INDENT>r.append(sub_list(i))<EOL><DEDENT>elif type(i) is dict:<EOL><INDENT>r.append(sub_dict(i))<EOL><DEDENT>else:<EOL><INDENT>r.append(str(i))<EOL><DEDENT><DEDENT>r = sorted(r)<EOL>return r<EOL>
Recursively walk a data-structure sorting any lists along the way.
Any unknown types get mapped to string representation

:param l: list
:return: sorted list, where any child lists are also sorted.