[issue30098] Verbose TypeError for asyncio.ensure_future

2017-04-19 Thread crenwick
crenwick added the comment: > Feel free to suggest a better wording. > I think the only change that needs to be made is to make the existing message > say 'asyncio.Future' instead of just 'Future'. I hear ya. New commit in the PR reverts the TypeError I add

[issue30098] Verbose TypeError for asyncio.ensure_future

2017-04-18 Thread crenwick
crenwick added the comment: Totally understandable. Some final thoughts: > this is the first time I see somebody tries to use `ensure_future` on > `run_coroutine_threadsafe` result, which suggests that it's not a common > problem. - I wonder how much self-reporting will be do

[issue30098] Verbose TypeError for asyncio.ensure_future

2017-04-18 Thread crenwick
crenwick added the comment: > it already raises a TypeError with a clear message This is more to my point: I found the TypeError message not clear at all. >From my prospective, I was using a future object returned from an asyncio >function to call another asyncio function, yet that

[issue30098] Verbose TypeError for asyncio.ensure_future

2017-04-18 Thread crenwick
crenwick added the comment: Totally. But this wasn't immediately clear to me when using the API. A verbose error like this one would have made this behavior more clear to me. -- ___ Python tracker <http://bugs.python.org/is

[issue30098] Verbose TypeError for asyncio.ensure_future

2017-04-18 Thread crenwick
New submission from crenwick: Despite the shy mention in the docs, it was not clear to me that the future returned from asyncio.run_coroutine_threadsafe is not compatible with asyncio.ensure_future (and other asyncio functions), and it took me a fair amount of frustration and source-code