def typecheck(expressions, signature=None):
 for expression in expressions:
  signature = expression.typecheck(signature)
 for expression in expressions[:(-1)]:
  expression.typecheck(signature)
 return signature

def typecheck ( expressions , signature = None ) : for expression in expressions : signature = expression . typecheck ( signature ) for expression in expressions [ : ( - 1 ) ] : expression . typecheck ( signature ) return signature
ensure correct typing across a collection of expression objects .