def __init__(sf, func_repr_result, arg_repr_results, ordered_kwarg_pairs): check_instance(IReprResult, func_repr_result) check_tuple(arg_repr_results) check_instance_all(IReprResult, arg_repr_results) check_tuple(ordered_kwarg_pairs) check_pairs_of(str, IReprResult, ordered_kwarg_pairs) # kw can be arbitrary str!!! # but when repr, "kw=arg", require identifier check_all(check_identifier, map(fst, ordered_kwarg_pairs)) sf.__f = func_repr_result sf.__xs = arg_repr_results sf.__ps = ordered_kwarg_pairs
def __init__(sf, baseobj_repr_result, key1_or_slice3_seq): check_instance(IReprResult, baseobj_repr_result) check_tuple(key1_or_slice3_seq) check_all(check_tuple, key1_or_slice3_seq) if not all(len(ks) in (1,3) for ks in key1_or_slice3_seq): raise TypeError for ks in key1_or_slice3_seq: L = len(ks) if L == 1: [key] = ks check_instance(IReprResult) elif L == 3: triple = ks for m in triple: check_instance_or_None(IReprResult, m) else: raise logic-err sf.__x = baseobj_repr_result sf.__kss = key1_or_slice3_seq
def __init__(sf, ordered_repr_results): check_tuple(ordered_repr_results) check_instance_all(IReprResult, ordered_repr_results) sf.__ls = ordered_repr_results
def __init__(sf, ordered_repr_result_pairs): check_tuple(ordered_repr_result_pairs) check_pairs_of(IReprResult, IReprResult, ordered_repr_result_pairs) sf.__ps = ordered_repr_result_pairs
def __init__(sf, tester_handler_pairs): check_tuple(tester_handler_pairs) check_pairs_of(BaseTester, IReprHandler, tester_handler_pairs) sf.__ps = tester_handler_pairs