Yury Selivanov <yseliva...@gmail.com> added the comment:

+1 on on the API and for adding it in 3.7 and for deprecating 
set_coroutine_wrapepr.  This will simplify asyncio code and other event loops 
(like uvloop) and will lead to less overhead on asyncio debug mode.

I always disliked the set_coroutine_wrapper API.  Even at the time when I added 
it to PEP 492 I understood that we'll have to replace it eventually with 
something more sensible.

I think we should start working on a patch.  Nathaniel, do you have time to 
champion the work?

> Most important: what format should we use for storing the origin information? 
> I can see three plausible approaches:

I'd be strongly against calling `traceback.StackSummary.extract` when coroutine 
object is created.  Let's go with the option 2.  You can create a list of tuple 
objects without the need of inventing a new struct.  coroutine.cr_origin (let's 
have the "cr_" prefix; dropping the prefixes should be considered in a separate 
issue) should return that list object directly.

I'm not sure how exactly the warning print logic will work with a list of 
tuples in cr_origin, I propose to start working on the implementation and 
figure that out during the review process.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32591>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to