def exec_sorted(statement, *args, **kw):
 return sorted([tuple(row) for row in statement.execute(*args, **kw).fetchall()])

def exec_sorted ( statement , * args , ** kw ) : return sorted ( [ tuple ( row ) for row in statement . execute ( * args , ** kw ) . fetchall ( ) ] )
executes a statement and returns a sorted list plain tuple rows .