Consider the following code in my WebApp2 application in Google App Engine:
count = 0
class MyHandler(webapp2.RequestHandler):
def get(self):
glob
In the case of your first question I think you might consider the webapp2.Request.registry feature. It's a dict to store instances that diferent modules can share during the lifetime of the request.
On the other hand it is also useful the webapp2.WSGIApplication.registry. In this case the instances persist between requests and can be shared (and reused) for whatever your app need during the lifetime of your application, avoiding creating instances on the global scope.