def path(self, target, args, kw):
        if type(target) in string_types:
            if ':' in target:
                prefix, rest = target.split(':', 1)
                route = self.named_routes[prefix]
                prefix_params = route._pop_params(args, kw)
                prefix_path = route.path([], prefix_params)
                next_mapper = route.resource
                return prefix_path + next_mapper.path(rest, args, kw)
            else:
                return self.named_routes[target].path(args, kw)
        elif isinstance(target, Route):
            for route in self.routes:
                if route is target:
                    return route.path(args, kw)
            raise InvalidArgumentError("Route '%s' not found in this %s object." % (target, self.__class__.__name__))
        else:
            target_id = id(target)
            if target_id in self._lookup:
                return self._lookup[target_id].path(args, kw)
            raise InvalidArgumentError("No Route found for target '%s' in this %s object." % (target, self.__class__.__name__))