[Python-ideas] async: feedback on EventLoop API

Antoine Pitrou solipsis at pitrou.net
Mon Dec 17 21:56:26 CET 2012


On Mon, 17 Dec 2012 12:49:46 -0800
Guido van Rossum <guido at python.org> wrote:
> On Mon, Dec 17, 2012 at 11:57 AM, Antoine Pitrou <solipsis at pitrou.net> wrote:
> > On Mon, 17 Dec 2012 09:47:22 -0800
> > Guido van Rossum <guido at python.org> wrote:
> >>
> >> (BTW, can someone *please* come up with a better name for DelayedCall?
> >> It's tedious and doesn't abbreviate well. But I don't want to name the
> >> class 'Callback' since I already use 'callback' for function objects
> >> that are used as callbacks.)
> >
> > Does it need to be abbreviated? I don't think users have to spell
> > "DelayedCall" at all (they just call call_later()).
> 
> They save the result in a variable. Naming that variable delayed_call
> feels awkward. In my code I've called it 'dcall' but that's not great
> either.
> 
> > That said, some proposals:
> > - Timer (might be mixed up with threading.Timer)
> 
> But often there's no time involved...

Ah, I see you use the same class for add_reader() and friends. I was
assuming that, like in Twisted, DelayedCall was only returned by
call_later().

Is it useful to return a DelayedCall in add_reader()? Is it so that you
can remove the reader? But you already define remove_reader() for that,
so I'm not sure what an alternative way to do it brings :-)

Regards

Antoine.





More information about the Python-ideas mailing list