'Return state information for pickling'

def __reduce__(self):

    items = [[k, self[k]] for k in self]
    inst_dict = vars(self).copy()
    for k in vars(OrderedDict()):
        inst_dict.pop(k, None)
    if inst_dict:
        return (self.__class__, (items,), inst_dict)
    return (self.__class__, (items,))
