'Configure an object with a user-supplied factory.'

def configure_custom(self, config):

    c = config.pop('()')
    if isinstance(c, basestring):
        c = self.resolve(c)
    props = config.pop('.', None)
    kwargs = dict([(k, config[k]) for k in config if valid_ident(k)])
    result = c(**kwargs)
    if props:
        for (name, value) in props.items():
            setattr(result, name, value)
    return result
