def type_or_constraint_repr(constraint):
 if isinstance(constraint, type):
  return constraint.__name__
 elif isinstance(constraint, Exactly):
  return repr(constraint)

def type_or_constraint_repr ( constraint ) : if isinstance ( constraint , type ) : return constraint . __name__ elif isinstance ( constraint , Exactly ) : return repr ( constraint )
generate correct repr for types and typeconstraints .