@staticmethod<EOL><INDENT>def inherit_dict(base, namespace, attr_name,<EOL>inherit=lambda k, v: True):<DEDENT>
items = []<EOL>base_dict = getattr(base, attr_name, {})<EOL>new_dict = namespace.setdefault(attr_name, {})<EOL>for key, value in base_dict.items():<EOL><INDENT>if key in new_dict or (inherit and not inherit(key, value)):<EOL><INDENT>continue<EOL><DEDENT>if inherit:<EOL><INDENT>new_dict[key] = value<EOL><DEDENT>items.append((key, value))<EOL><DEDENT>return items<EOL>
Perform inheritance of dictionaries.  Returns a list of key
and value pairs for values 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
                  dictionary 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
                key and value, 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.