[issue28430] asyncio: C implemeted Future cause Tornado test fail

INADA Naoki report at bugs.python.org
Thu Oct 20 21:37:15 EDT 2016


INADA Naoki added the comment:

pure Python Future.__iter__ don't use what yield-ed.

    def __iter__(self):
        if not self.done():
            self._asyncio_future_blocking = True
            yield self  # This tells Task to wait for completion.
        assert self.done(), "yield from wasn't used with future"
        return self.result()  # May raise too.

I felt no-None value is sent by iter.send(val) wasn't make sense.
But Tornado did it (maybe, for compatibility to Tornado's generator.)

So this patch ignores when non-None value is passed.
Additionally, I moved NEWS entry about C Future from "core and builtin"
section to "library" section.

----------
keywords: +patch
stage:  -> commit review
Added file: http://bugs.python.org/file45165/future-iter-send.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28430>
_______________________________________


More information about the Python-bugs-list mailing list