Skip to content

Avoid Direct Creation Of Future And Task Objects #110

@ldo

Description

@ldo

Note that the asyncio docs say that loop.create_future() and loop.create_task() are the preferred ways of creating Future and Task objects, rather than instantiating them directly.

This patch removes the direct instantiation calls in favour of calling those API routines.

Also, I don’t think you should be subclassing Future; leave that sort of thing to event-loop implementations. That would fix the multiple instances of this warning that I get with Python 3.10:

/home/ldo/sources/panoramisk-git/panoramisk/actions.py:34: DeprecationWarning: There is no current event loop
asyncio.Future.__init__(self)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions