On Fri, Feb 27, 2015 at 5:52 PM, Guido van Rossum <gu...@python.org> wrote: > Because of the way as_completed() works, it sometimes makes up new futures > on the spot. The new futures will have the result/error from the original > future but the mapping from original future to new future is indeterminate > until a result is ready.
Using Guido's explanation above, we could improve that note in asyncio.as_completed [1] adding a second sentence: """ Note: The futures f are not necessarily members of fs. A given future may be wrapped in another future by as_completed; when that happens, the result/error of the new future will be the same as the original future. """ [1] https://docs.python.org/3/library/asyncio-task.html#asyncio.as_completed Best, Luciano > > On Fri, Feb 27, 2015 at 12:42 PM, Luciano Ramalho <luci...@ramalho.org> > wrote: >> >> Hello, in the docs for the asyncio.as_completed function [1] there's a >> note that says "The futures f are not necessarily members of fs." >> >> [1] >> https://docs.python.org/3/library/asyncio-task.html#asyncio.as_completed >> >> Which other futures apart from those in the fs argument may be yielded >> by as_completed? >> >> Thanks! >> >> -- >> Luciano Ramalho >> Twitter: @ramalhoorg >> >> Professor em: http://python.pro.br >> Twitter: @pythonprobr > > > > > -- > --Guido van Rossum (python.org/~guido) -- Luciano Ramalho Twitter: @ramalhoorg Professor em: http://python.pro.br Twitter: @pythonprobr