
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2016-10-13 12:43 bymethane, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| future-iter-send.patch | methane,2016-10-21 01:37 | review | ||
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 552 | closed | dstufft,2017-03-31 16:36 | |
| Messages (9) | |||
|---|---|---|---|
| msg278569 -(view) | Author: Inada Naoki (methane)*![]() | Date: 2016-10-13 12:43 | |
https://travis-ci.org/tornadoweb/tornado/jobs/167252979 | |||
| msg278686 -(view) | Author: Inada Naoki (methane)*![]() | Date: 2016-10-15 02:11 | |
Another test failure is reported.> I have setup a 3.6 build on Travis of our project GNS3 and it seem to fail.>https://travis-ci.org/GNS3/gns3-server/builds/167703118 | |||
| msg279095 -(view) | Author: Inada Naoki (methane)*![]() | Date: 2016-10-21 01:37 | |
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. | |||
| msg279104 -(view) | Author: Inada Naoki (methane)*![]() | Date: 2016-10-21 03:23 | |
Test failure in GNS3 seems not relating to this.It may be fixed via#28492, maybe. | |||
| msg279150 -(view) | Author: Yury Selivanov (yselivanov)*![]() | Date: 2016-10-21 21:00 | |
The patch looks good. 2 things:- It appears it also touchesMisc/NEWS a bit too much. Please make sure to not to commit that.- I'd also add a comment explaining why we ignore values passed to FI.send() and simply send None. The reason is how Future.__iter__ is designed: class Future: 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.^-- Future.__iter__ doesn't care about values that are pushed to the generator, it just returns "self.result()". | |||
| msg279382 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2016-10-25 10:11 | |
New changesetb471447352ac by INADA Naoki in branch '3.6':Issue#28430: Fix iterator of C implemented asyncio.Future doesn'thttps://hg.python.org/cpython/rev/b471447352acNew changesetbd141ec2973a by INADA Naoki in branch 'default':Issue#28430: Fix iterator of C implemented asyncio.Future doesn'thttps://hg.python.org/cpython/rev/bd141ec2973a | |||
| msg279388 -(view) | Author: Inada Naoki (methane)*![]() | Date: 2016-10-25 10:31 | |
> - It appears it also touchesMisc/NEWS a bit too much. Please make sure to not to commit that.I wont to move move this entry from "Core and Builtins" section to "Library" section:- Issue#26081: Added C implementation of asyncio.Future. Original patch by Yury Selivanov.May I do it? | |||
| msg279404 -(view) | Author: Terry J. Reedy (terry.reedy)*![]() | Date: 2016-10-25 13:32 | |
+- Issue#28430: Fix iterator of C implemented asyncio.Future doesn't accept+ non-None value is passed to it.send(val).This NEWS entry is not a coherent English sentence. Please revise. I don't understand it well enough to suggest a revision, but would review a replacement. | |||
| msg279406 -(view) | Author: Inada Naoki (methane)*![]() | Date: 2016-10-25 13:39 | |
I'm sorry about my bad English.> Fix iterator of C implemented asyncio.FutureThis meant:fut = asyncio.Future() # C implemented version of asyncio.Futureit = iter(fut) # Iterator of itit.send(42) # raised TypeError before. It was not compatible with Python version of asyncio.Future | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:38 | admin | set | github: 72616 |
| 2017-03-31 16:36:16 | dstufft | set | pull_requests: +pull_request904 |
| 2016-10-25 13:39:36 | methane | set | messages: +msg279406 |
| 2016-10-25 13:32:18 | terry.reedy | set | nosy: +terry.reedy messages: +msg279404 |
| 2016-10-25 10:31:07 | methane | set | status: open -> closed resolution: fixed messages: +msg279388 stage: commit review -> resolved |
| 2016-10-25 10:11:52 | python-dev | set | nosy: +python-dev messages: +msg279382 |
| 2016-10-21 21:00:01 | yselivanov | set | messages: +msg279150 |
| 2016-10-21 03:23:50 | methane | set | messages: +msg279104 |
| 2016-10-21 01:37:15 | methane | set | files: +future-iter-send.patch keywords: +patch messages: +msg279095 stage: commit review |
| 2016-10-15 02:11:45 | methane | set | messages: +msg278686 |
| 2016-10-14 14:35:39 | socketpair | set | nosy: +socketpair |
| 2016-10-13 12:43:15 | methane | create | |