Why are CherryPy object attributes persistent between requests?
问题 I was writing debugging methods for my CherryPy application. The code in question was (very) basically equivalent to this: import cherrypy class Page: def index(self): try: self.body += 'okay' except AttributeError: self.body = 'okay' return self.body index.exposed = True cherrypy.quickstart(Page(), config='root.conf') I was surprised to notice that from request to request, the output of self.body grew. When I visited the page from one client, and then from another concurrently-open client,