def _dump(cls, data, kind=1): lookup = {1:'B', 2:'H', 4:'I', 8:'L'} itemtype = lookup.get(kind, kind) return array.array(itemtype, data) ## specific dumping formats