我开始学习使用谷歌应用引擎,在我遇到的大部分代码中,它们将webapp.WSGIApplication的实例声明为全局变量。这似乎不是必需的,因为代码在main函数中本地声明时可以正常工作。我总是被告知应该避免使用全局变量。那么这样做有什么好的,甚至不太好的理由吗?例子:classGuestbook(webapp.RequestHandler):defpost(self):greeting=Greeting()ifusers.get_current_user():greeting.author=users.get_current_user()greeting.content=self.