def yieldroutes(func):
 import inspect
 path = ('/' + func.__name__.replace('__', '/').lstrip('/'))
 spec = inspect.getargspec(func)
 argc = (len(spec[0]) - len((spec[3] or [])))
 path += (('/:%s' * argc) % tuple(spec[0][:argc]))
 (yield path)
 for arg in spec[0][argc:]:
  path += ('/:%s' % arg)
  (yield path)

def yieldroutes ( func ) : import inspect path = ( '/' + func . __name__ . replace ( '__' , '/' ) . lstrip ( '/' ) ) spec = inspect . getargspec ( func ) argc = ( len ( spec [ 0 ] ) - len ( ( spec [ 3 ] or [ ] ) ) ) path += ( ( '/:%s' * argc ) % tuple ( spec [ 0 ] [ : argc ] ) ) ( yield path ) for arg in spec [ 0 ] [ argc : ] : path += ( '/:%s' % arg ) ( yield path )
return a generator for routes that match the signature of the func parameter .