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 <rep...@bugs.python.org>
<http://bugs.python.org/issue28430>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to