コード例 #1
0
 def switch(self):
     """coro.switch() -> returnvalue
        switches to coroutine coro. If the bound function
        f finishes, the returnvalue is that of f, otherwise
        None is returned
     """
     try:
         return greenlet.switch(self._frame)
     except TypeError, exp:  # self._frame is the main coroutine
         return greenlet.switch(self._frame.something)
コード例 #2
0
ファイル: stackless.py プロジェクト: antoine1fr/pygirl
 def switch(self):
     """coro.switch() -> returnvalue
        switches to coroutine coro. If the bound function
        f finishes, the returnvalue is that of f, otherwise
        None is returned
     """
     try:
         return greenlet.switch(self._frame)
     except TypeError, exp: # self._frame is the main coroutine
         return greenlet.switch(self._frame.something)