def _abstract_atom_init(deftype, defvalue):
    """Return a constructor for an abstract `Atom` class."""

    defitemsize = split_type(deftype)[1]

    def __init__(self, itemsize=defitemsize, shape=(), dflt=defvalue):
        assert self.kind in atom_map
        try:
            atomclass = atom_map[self.kind][itemsize]
        except __HOLE__:
            raise _invalid_itemsize_error(self.kind, itemsize,
                                          atom_map[self.kind])
        self.__class__ = atomclass
        atomclass.__init__(self, shape, dflt)
    return __init__
dataset/ETHPy150Open PyTables/PyTables/tables/atom.py/_abstract_atom_init