예제 #1
0
    def __init__(self, inp):
        if not isinstance(inp, OrderedDict):
            try:
                inp = OrderedDict(inp)
            except (TypeError,ValueError):
                raise ValueError("Input to TableList must be an OrderedDict or list of (k,v) pairs")

        self._dict = inp
        super(TableList,self).__init__(inp.values())
예제 #2
0
    def __init__(self, inp):
        if not isinstance(inp, OrderedDict):
            try:
                inp = OrderedDict(inp)
            except (TypeError, ValueError):
                raise ValueError("Input to TableList must be an OrderedDict "
                                 "or list of (k,v) pairs")

        self._dict = inp
        super(TableList, self).__init__(inp.values())
예제 #3
0
    def __init__(self, inp):
        if not isinstance(inp, OrderedDict):
            # py3 doesn't let you catch 2 types of errors.
            errmsg = "Input to TableList must be an OrderedDict or list of (k,v) pairs"
            try:
                inp = OrderedDict(inp)
            except (TypeError, ValueError):
                raise ValueError("Input to TableList must be an OrderedDict or list of (k,v) pairs")

        self._dict = inp
        super(TableList, self).__init__(inp.values())
예제 #4
0
    def __init__(self, inp):
        if not isinstance(inp, OrderedDict):
            # py3 doesn't let you catch 2 types of errors.
            errmsg = "Input to TableList must be an OrderedDict or list of (k,v) pairs"
            try:
                inp = OrderedDict(inp)
            except (TypeError, ValueError):
                raise ValueError("Input to TableList must be an OrderedDict or list of (k,v) pairs")

        self._dict = inp
        super(TableList, self).__init__(inp.values())