'Updates the given defaults with values from the config files and
the environ. Does a little special handling for certain types of
options (lists).'

def _update_defaults(self, defaults):

    config = {}
    for section in ('global', self.name):
        config.update(self.normalize_keys(self.get_config_section(section)))
    if (not self.isolated):
        config.update(self.normalize_keys(self.get_environ_vars()))
    self.values = optparse.Values(self.defaults)
    late_eval = set()
    for (key, val) in config.items():
        if (not val):
            continue
        option = self.get_option(key)
        if (option is None):
            continue
        if (option.action in ('store_true', 'store_false', 'count')):
            val = strtobool(val)
        elif (option.action == 'append'):
            val = val.split()
            val = [self.check_default(option, key, v) for v in val]
        elif (option.action == 'callback'):
            late_eval.add(option.dest)
            opt_str = option.get_opt_string()
            val = option.convert_value(opt_str, val)
            args = (option.callback_args or ())
            kwargs = (option.callback_kwargs or {})
            option.callback(option, opt_str, val, self, *args, **kwargs)
        else:
            val = self.check_default(option, key, val)
        defaults[option.dest] = val
    for key in late_eval:
        defaults[key] = getattr(self.values, key)
    self.values = None
    return defaults
