Beispiel #1
0
 def __init__(self, prec):
     if isinstance(prec, PrecisionDeg2):
         self.__prec = prec.__prec
         self.__type = prec.__type
     elif isinstance(prec, (int, Integer)):
         self.__prec = prec
         self.__type = "diag_max"
     elif isinstance(prec, (frozenset, set, tuple, list)) \
             and all([_is_triple_of_integers(a) for a in prec]):
         self.__prec = frozenset(prec)
         self.__type = "tuples"
     else:
         raise TypeError("self must be an integer or " +
                         "a collection of tuples of integers.")
Beispiel #2
0
 def __init__(self, tpl):
     (self._n, self._r, self._m) = tpl
     if not _is_triple_of_integers(tpl):
         raise TypeError("tpl must be a triple of integers.")
     self._t = tpl