def op_sequence(op, *classes):
 log = []
 instances = []
 for c in classes:
  instances.append(c(log.append))
 try:
  op(*instances)
 except TypeError:
  pass
 return log

def op_sequence ( op , * classes ) : log = [ ] instances = [ ] for c in classes : instances . append ( c ( log . append ) ) try : op ( * instances ) except TypeError : pass return log
return the sequence of operations that results from applying the operation op to instances of the given classes .