@staticmethod<EOL><INDENT>def inherit_set(base, namespace, attr_name,<EOL>inherit=lambda i: True):<DEDENT>
items = []<EOL>base_set = getattr(base, attr_name, set())<EOL>new_set = namespace.setdefault(attr_name, set())<EOL>for item in base_set:<EOL><INDENT>if item in new_set or (inherit and not inherit(item)):<EOL><INDENT>continue<EOL><DEDENT>if inherit:<EOL><INDENT>new_set.add(item)<EOL><DEDENT>items.append(item)<EOL><DEDENT>return items<EOL>
Perform inheritance of sets.  Returns a list of items that
were inherited, for post-processing.

:param base: The base class being considered; see
             ``iter_bases()``.
:param namespace: The dictionary of the new class being built.
:param attr_name: The name of the attribute containing the set
                  to be inherited.
:param inherit: Filtering function to determine if a given
                item should be inherited.  If ``False`` or
                ``None``, item will not be added, but will be
                included in the returned items.  If a
                function, the function will be called with the
                item, and the item will be added and included
                in the items list only if the function returns
                ``True``.  By default, all items are added and
                included in the items list.