This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author yselivanov
Recipients asvetlov, giampaolo.rodola, gvanrossum, njs, yselivanov
Date 2018-01-20.16:11:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1516464719.99.0.467229070634.issue32591@psf.upfronthosting.co.za>
In-reply-to
Content
Guido,

I'd like to go forward with this and merge Nathaniel's PR.

Quick summary:

* This issue adds new APIs: a sys.set_coroutine_origin_tracking_depth(depth) function and a 'cr_origin' property to native coroutine objects.

* By using this APIs, users can opt-in to save traceback (serialized as tuples of `(funcname, filename, line)`) of where native coroutines are created.

* This allows us to deprecate the sys.set_coroutine_wrapper function, which I never liked.  It's too powerful as it allows anyone to intercept/override native coroutine construction logic.

* In turn, we are removing a lot of complexity from asyncio code: starting with 3.7 we'll use CoroWrapper only for generator-based corotuines; at some point (Python 3.9?) when we remove @asyncio.coroutine we'll be able to remove CoroWrapper.  This will also make asyncio debug mode quite a bit faster, allowing people to use it in production.

* Finally, sys.set_coroutine_wrapper was always documented as a debug-only API that might disappear in future CPython releases.  We'll deprecate it in 3.7 and remove it in 3.8.

Are you OK with this?
History
Date User Action Args
2018-01-20 16:12:00yselivanovsetrecipients: + yselivanov, gvanrossum, giampaolo.rodola, njs, asvetlov
2018-01-20 16:11:59yselivanovsetmessageid: <1516464719.99.0.467229070634.issue32591@psf.upfronthosting.co.za>
2018-01-20 16:11:59yselivanovlinkissue32591 messages
2018-01-20 16:11:59yselivanovcreate