On 08:39 pm, [email protected] wrote: > >Okay. I attended Ray's Hettinger's talk on Monocle. In the past >I have encountered situations where I bumped up with the nesting >problem. >If I recall, the problem involved request handlers that had a RPC style >AND made additional Twisted deferred calls: > >class MyRequestHandler(...): > > @defer.inlineCallbacks > def process(self): > try: > result = yield >client.getPage("http://www.google.com") > except Exception, err: > log.err(err, "process getPage call >failed") > else: > # do some processing with the result > return result > >looks reasonable but Python will balk.
Aside from the "return result" (should be defer.returnValue(result), generators can't return with a value), this looks fine to me too. Why do you say Python will balk? Jean-Paul _______________________________________________ [email protected] http://codespeak.net/mailman/listinfo/pypy-dev
