#NEWLINE# def sort_by_field( obj , field = 'name' ) : #NEWLINE# #INDENT# def _by_field( item1 , item2 ) : #NEWLINE# #INDENT# return cmp ( item1 [ field ] , item2 [ field ] ) #NEWLINE# #UNINDENT# obj . sort ( obj )