def check_config(self, config, name=''):
        '''Check that the configuration for this object is valid.

        This is a more restrictive check than for most :mod:`yakonfig`
        objects.  It will raise :exc:`yakonfig.ConfigurationError` if
        `config` contains any keys that are not in the underlying
        callable's parameter list (that is, extra unused configuration
        options).  This will also raise an exception if `config`
        contains keys that duplicate parameters that should be
        provided by the factory.

        .. note:: This last behavior is subject to change; future
                  versions of the library may allow configuration to
                  provide local configuration for a factory-provided
                  object.

        :param dict config: the parent configuration dictionary,
          probably contains :attr:`config_name` as a key
        :param str name: qualified name of this object in the configuration
        :raise: :exc:`yakonfig.ConfigurationError` if excess parameters exist

        '''
        # This is assuming that `config` is the config dictionary of
        # the *config parent*. That is, `config[self.config_name]`
        # exists.
        config = config.get(self.config_name, {})

        # Complain about additional parameters, unless this is an
        # older object that's expecting a config dictionary.
        extras = set(config.keys()).difference(self.default_config)
        if 'config' not in self.services and extras:
            raise ConfigurationError(
                'Unsupported config options for "%s": %s'
                % (self.config_name, ', '.join(extras)))

        # This only happens if you went out of your way to
        # circumvent the configuration and delete a parameter.
        missing = set(self.default_config).difference(config)
        if missing:
            raise ConfigurationError(
                'Missing config options for "%s": %s'
                % (self.config_name, ', '.join(missing)))

        # Did caller try to provide parameter(s) that we also expect
        # the factory to provide?
        duplicates = set(config.keys()).intersection(set(self.services))
        if duplicates:
            # N.B. I don't think the parameter can come from the
            # default config because Python will not let you have
            # `arg` and `arg=val` in the same parameter
            # list. (`discover_config`, below, guarantees that
            # positional and named parameters are disjoint.)
            raise ConfigurationError(
                'Disallowed config options for "%s": %s'
                % (self.config_name, ', '.join(duplicates)))
Check that the configuration for this object is valid.

        This is a more restrictive check than for most :mod:`yakonfig`
        objects.  It will raise :exc:`yakonfig.ConfigurationError` if
        `config` contains any keys that are not in the underlying
        callable's parameter list (that is, extra unused configuration
        options).  This will also raise an exception if `config`
        contains keys that duplicate parameters that should be
        provided by the factory.

        .. note:: This last behavior is subject to change; future
                  versions of the library may allow configuration to
                  provide local configuration for a factory-provided
                  object.

        :param dict config: the parent configuration dictionary,
          probably contains :attr:`config_name` as a key
        :param str name: qualified name of this object in the configuration
        :raise: :exc:`yakonfig.ConfigurationError` if excess parameters exist