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 tinchester
Recipients ajoino, alex.gronholm, asvetlov, chris.jerdonek, gvanrossum, iritkatriel, jab, njs, tinchester, yselivanov
Date 2022-02-17.15:51:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1645113087.11.0.190588874238.issue46771@roundup.psfhosted.org>
In-reply-to
Content
Hello Andrew, here's some followup.

About the names: the move_on_after and fail_after names are from Trio. I don't have strong feeling about them at all, whatever most people like.

About move_on_after vs loop.call_at and loop.call_later: move_on_after is much more usable in practice, since it doesn't require splitting your coroutine in several. And it's very useful in production code; when dealing with 3rd party APIs you want to wait a reasonable time and continue on your way if the 3rd party API stalls.

About `async with` vs `with`: I have strong feelings for `with`. It's not a performance issue; I don't care about that. `async with` to me says there are suspension points involved; this coroutine might or might not be suspended either entering or existing. With a bare `with` I *know* there is no suspension. This is important to keep my concurrent code more correct, which is hard enough.

About overriding the task factory: the default Task implementation is implemented in C, correct? I would be way too scared of putting my (Python) implementation in there because of performance. Spending years shaving microseconds off in my other libraries to risk losing it all because I want better cancellation in asyncio would feel really bad. Ideally we can get a good-enough solution in the stdlib so users don't have to do this.

About your point 3, first graph: you are right if both context managers propagate exceptions. If the inner one is set to swallow (`move_on_after`) OR the user plans on swallowing the inner one, the problem is *not* solved  (or at least I don't understand the solution). This is the code sample from https://bugs.python.org/issue46771#msg413368. And I think swallowing is an important use case, as I've already mentioned.

About the special field for nonce: I'm OK with smuggling the nonce in the message. But I stand by my proposal for making the nonce a monotonic number, and that would require a special field to be clean.
History
Date User Action Args
2022-02-17 15:51:27tinchestersetrecipients: + tinchester, gvanrossum, njs, jab, asvetlov, alex.gronholm, chris.jerdonek, yselivanov, iritkatriel, ajoino
2022-02-17 15:51:27tinchestersetmessageid: <1645113087.11.0.190588874238.issue46771@roundup.psfhosted.org>
2022-02-17 15:51:27tinchesterlinkissue46771 messages
2022-02-17 15:51:26tinchestercreate