You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python 3.8 adds a name argument to the function asyncio.create_task. This allows to give all tasks an interpretable name, which can help with debugging and also provides more transparency for users.
We should
revisit our code base to check all uses of asyncio.create_task and provide meaningful names
if possible, also extend the unit tests to assert that the name is set on the tasks. I'm not entirely sure if that's possible
A PR in this direction is very welcome. As long as #3728 is open, it should be based on the drop-py-37 branch. If you would like to send a PR, please be sure to read our contribution guide and leave a short comment so that we can assign you.
The text was updated successfully, but these errors were encountered:
Seems to me that asyncio.create_task is called only 4 times in the whole code (3 in telegram.ext._application.py and 1 in telegram.ext._updater.py) except for tests.
I don't think that tasks in tests need to be named, to be honest...
Furthermore, it's possible to get the name of a task using get_name() and assert it, but it's really necessary?
I don't think that tasks in tests need to be named, to be honest...
True
Furthermore, it's possible to get the name of a task using get_name() and assert it, but it's really necessary?
In general, tests should cover every behavior that we want to protect from regression and in particular this includes any documented behavior. I agree that naming of the internal tasks is not necessary to document and probably hard to test, so I'm fine with skipping that.
Another thought that I had is that we can add the name argument to our Application.create_task wrapper. It should be a keyword-only argument as in the std-lib. This must however be tested :)
Python 3.8 adds a
name
argument to the functionasyncio.create_task
. This allows to give all tasks an interpretable name, which can help with debugging and also provides more transparency for users.We should
asyncio.create_task
and provide meaningful namesA PR in this direction is very welcome. As long as #3728 is open, it should be based on the
drop-py-37
branch. If you would like to send a PR, please be sure to read our contribution guide and leave a short comment so that we can assign you.The text was updated successfully, but these errors were encountered: