Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] Future: implement add_done_callback for asyncio compat (bug 591760)
Date: Sun, 26 Mar 2017 21:07:54
Message-Id: CAMiTYSrTNZCEZTE6_EfXFvpOyqE-0s1=sA53VHz7SJ00RRVqhw@mail.gmail.com
In Reply to: Re: [gentoo-portage-dev] [PATCH] Future: implement add_done_callback for asyncio compat (bug 591760) by Brian Dolbec
1 On Sun, Mar 26, 2017 at 12:07 PM, Brian Dolbec <dolsen@g.o> wrote:
2 > On Sun, 26 Mar 2017 03:13:11 -0700
3 > Zac Medico <zmedico@g.o> wrote:
4 >
5 >> Implement the add_done_callback and remove_done_callback methods,
6 >> since they are required in order to make further progress toward
7 >> asyncio compatibility.
8 >>
9 >> Also implement the AbstractEventLoop create_future method for the
10 >> EventLoop class, so that it returns an instance of _EventLoopFuture.
11 >> EventLoop currently does not implement some of the
12 >> asyncio.AbstractEventLoop methods that asyncio.Future requires for
13 >> its add_done_callback implementation, and the create_future method
14 >> conveniently solves this problem.
15 >>
16 >> X-Gentoo-bug: 591760
17 >> X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=591760
18 >> ---
19 >> pym/portage/tests/ebuild/test_ipc_daemon.py | 3 +-
20 >> .../tests/util/eventloop/test_call_soon_fifo.py | 6 +-
21 >> pym/portage/tests/util/futures/__init__.py | 0
22 >> pym/portage/tests/util/futures/__test__.py | 0
23 >> .../tests/util/futures/test_done_callback.py | 35 +++++++++
24 >> pym/portage/util/_async/SchedulerInterface.py | 3 +-
25 >> pym/portage/util/_eventloop/EventLoop.py | 14 ++++
26 >> pym/portage/util/futures/futures.py | 82
27 >> ++++++++++++++++++++-- 8 files changed, 132 insertions(+), 11
28 >> deletions(-) create mode 100644
29 >> pym/portage/tests/util/futures/__init__.py create mode 100644
30 >> pym/portage/tests/util/futures/__test__.py create mode 100644
31 >> pym/portage/tests/util/futures/test_done_callback.py
32 >>
33 >
34 > looks fine... /me ignoring the lack of parameters descriptions in the
35 > docstrings
36
37 Yeah, I skipped parameter docstrings because the interfaces are
38 compatible with the python standard libraries.
39
40 Pushed:
41
42 https://gitweb.gentoo.org/proj/portage.git/commit/?id=4b12ed04ec6b99f5a948e0eea5778a4fac502740
43 --
44 Thanks,
45 Zac