Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid Direct Creation Of Future And Task Objects #110

Open
ldo opened this issue Nov 19, 2022 · 0 comments
Open

Avoid Direct Creation Of Future And Task Objects #110

ldo opened this issue Nov 19, 2022 · 0 comments

Comments

@ldo
Copy link

ldo commented Nov 19, 2022

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant