def _match_routes(iter_func, request, extra_args=None, extra_kwargs=None):
 method_not_allowed = False
 for route in iter_func():
  try:
   match = route.match(request)
   if match:
    (route, args, kwargs) = match
    if extra_args:
     args += extra_args
    if extra_kwargs:
     kwargs.update(extra_kwargs)
    return (route, args, kwargs)
  except exc.HTTPMethodNotAllowed:
   method_not_allowed = True
 if method_not_allowed:
  raise exc.HTTPMethodNotAllowed()

def _match_routes ( iter_func , request , extra_args = None , extra_kwargs = None ) : method_not_allowed = False for route in iter_func ( ) : try : match = route . match ( request ) if match : ( route , args , kwargs ) = match if extra_args : args += extra_args if extra_kwargs : kwargs . update ( extra_kwargs ) return ( route , args , kwargs ) except exc . HTTPMethodNotAllowed : method_not_allowed = True if method_not_allowed : raise exc . HTTPMethodNotAllowed ( )
tries to match a route given an iterator .