I'm not sure actually. Does Task have any public methods that it doesn't inherit from Future? I think the more fundamental *interface* is Future, while Task (mostly) provides a specific implementation.
On Mon, Jul 7, 2014 at 7:03 AM, Victor Stinner <[email protected]> wrote: > 2014-07-07 15:58 GMT+02:00 Luca Sbardella <[email protected]>: > >> Does the Pulsar Task class inherit from asyncio.Task? > > > > Yes, it overrides the _step and _wakeup methods. > > I asked because I wrote this in set_task_factory() docstring: > "The factory should return task objects of type asyncio.Task or a > subclass of asyncio.Task." > > > However, it could simply inherit from asyncio.Future. > > If you do that, it may break code in the future, if asyncio is > modified. It's safer to use a sublass of Task. Don't you think so? > > Victor > -- --Guido van Rossum (python.org/~guido)
