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 giampaolo.rodola, gvanrossum, pitrou, yselivanov
Date 2017-11-07.15:48:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1510069685.33.0.213398074469.issue31960@psf.upfronthosting.co.za>
In-reply-to
Content
> My underlying question is why the Future has to set its loop in its constructor, instead of simply using get_event_loop() inside _schedule_callbacks().  This would always work.

So imagine a Future `fut` is completed. And we call `fut.add_done_callback()` in different contexts with different active event loops.  With your suggestion we'll schedule our callbacks in different loops.

Ideally you should use `loop.create_future()` when you can (and in libraries you usually can do that) to always make it explicit which loop your Future is attached to.
History
Date User Action Args
2017-11-07 15:48:05yselivanovsetrecipients: + yselivanov, gvanrossum, pitrou, giampaolo.rodola
2017-11-07 15:48:05yselivanovsetmessageid: <1510069685.33.0.213398074469.issue31960@psf.upfronthosting.co.za>
2017-11-07 15:48:05yselivanovlinkissue31960 messages
2017-11-07 15:48:05yselivanovcreate