'Same as replace_column but issues warnings under various circumstances.'

def _replace_column_warnings(self, name, col):

    warns = conf.replace_warnings
    if ((u'refcount' in warns) and (name in self.colnames)):
        refcount = sys.getrefcount(self[name])
    if (name in self.colnames):
        old_col = self[name]
    self.replace_column(name, col)
    if (u'always' in warns):
        warnings.warn(u"replaced    column    '{}'".format(name), TableReplaceWarning, stacklevel=3)
    if (u'slice' in warns):
        try:
            if isinstance(old_col.base, old_col.__class__):
                msg = u"replaced    column    '{}'    which    looks    like    an    array    slice.    The    new    column    no    longer    shares    memory    with    the    original    array.".format(name)
                warnings.warn(msg, TableReplaceWarning, stacklevel=3)
        except AttributeError:
            pass
    if (u'refcount' in warns):
        new_refcount = sys.getrefcount(self[name])
        if (refcount != new_refcount):
            msg = u"replaced    column    '{}'    and    the    number    of    references    to    the    column    changed.".format(name)
            warnings.warn(msg, TableReplaceWarning, stacklevel=3)
    if (u'attributes' in warns):
        changed_attrs = []
        new_col = self[name]
        for attr in DataInfo.attr_names:
            if (getattr(old_col.info, attr) != getattr(new_col.info, attr)):
                changed_attrs.append(attr)
        if changed_attrs:
            msg = u"replaced    column    '{}'    and    column    attributes    {}    changed.".format(name, changed_attrs)
            warnings.warn(msg, TableReplaceWarning, stacklevel=3)
