a decorator . A decorator is a function that wraps another function. After decoration the function will be a WSGI application, but it will be decorating a function with a signature like controller_func(req, **urlvars) . The controller function will return a response object (which, remember, is a WSGI application on its own). line 3 : This is the typical signature for a decorator -- it takes one function as an argument, and returns a wrapped function. line 4 : This is the replacement function we'll return. This is called a closure -- this function will have access to func , and everytime you decorate a new function there will be a new replacement function with its own value of func . As you can see, this is a WSGI application. line 5 : We create a request. line 6 : Here we catch any webob.exc.HTTPException exceptions. This is so you can do raise webob.exc.HTTPNotFound() in your function. These exceptions are themselves WSGI applications. line 7 : We call the function with the request object, any any variables in req.urlvars . And we get back a response. line 10 : We'll allow the function to return a full response object, or just a string. If they return a string, we'll create a Response object with that (and with the standard 200 OK status, text/html content type, and utf8 charset/encoding). line 12 : We pass the request on to the response. Which also happens to be a WSGI application. WSGI applications are