'Configure settings related to inherting and/or inherited mappers
being present.'

def _configure_inheritance(self):

    self._inheriting_mappers = util.WeakSequence()
    if self.inherits:
        if isinstance(self.inherits, type):
            self.inherits = class_mapper(self.inherits, configure=False)
        if (not issubclass(self.class_, self.inherits.class_)):
            raise sa_exc.ArgumentError(("Class    '%s'    does    not    inherit    from    '%s'" % (self.class_.__name__, self.inherits.class_.__name__)))
        if (self.non_primary != self.inherits.non_primary):
            np = (((not self.non_primary) and 'primary') or 'non-primary')
            raise sa_exc.ArgumentError(("Inheritance    of    %s    mapper    for    class    '%s'    is    only    allowed    from    a    %s    mapper" % (np, self.class_.__name__, np)))
        if (self.local_table is None):
            self.local_table = self.inherits.local_table
            self.mapped_table = self.inherits.mapped_table
            self.single = True
        elif (not (self.local_table is self.inherits.local_table)):
            if self.concrete:
                self.mapped_table = self.local_table
                for mapper in self.iterate_to_root():
                    if (mapper.polymorphic_on is not None):
                        mapper._requires_row_aliasing = True
            else:
                if (self.inherit_condition is None):
                    self.inherit_condition = sql_util.join_condition(self.inherits.local_table, self.local_table)
                self.mapped_table = sql.join(self.inherits.mapped_table, self.local_table, self.inherit_condition)
                fks = util.to_set(self.inherit_foreign_keys)
                self._inherits_equated_pairs = sql_util.criterion_as_pairs(self.mapped_table.onclause, consider_as_foreign_keys=fks)
        else:
            self.mapped_table = self.local_table
        if ((self.polymorphic_identity is not None) and (not self.concrete)):
            self._identity_class = self.inherits._identity_class
        else:
            self._identity_class = self.class_
        if (self.version_id_col is None):
            self.version_id_col = self.inherits.version_id_col
            self.version_id_generator = self.inherits.version_id_generator
        elif ((self.inherits.version_id_col is not None) and (self.version_id_col is not self.inherits.version_id_col)):
            util.warn(("Inheriting    version_id_col    '%s'    does    not    match    inherited    version_id_col    '%s'    and    will    not    automatically    populate    the    inherited    versioning    column.    version_id_col    should    only    be    specified    on    the    base-most    mapper    that    includes    versioning." % (self.version_id_col.description, self.inherits.version_id_col.description)))
        if ((self.order_by is False) and (not self.concrete) and (self.inherits.order_by is not False)):
            self.order_by = self.inherits.order_by
        self.polymorphic_map = self.inherits.polymorphic_map
        self.batch = self.inherits.batch
        self.inherits._inheriting_mappers.append(self)
        self.base_mapper = self.inherits.base_mapper
        self.passive_updates = self.inherits.passive_updates
        self._all_tables = self.inherits._all_tables
        if (self.polymorphic_identity is not None):
            self.polymorphic_map[self.polymorphic_identity] = self
    else:
        self._all_tables = set()
        self.base_mapper = self
        self.mapped_table = self.local_table
        if (self.polymorphic_identity is not None):
            self.polymorphic_map[self.polymorphic_identity] = self
        self._identity_class = self.class_
    if (self.mapped_table is None):
        raise sa_exc.ArgumentError(("Mapper    '%s'    does    not    have    a    mapped_table    specified." % self))
