GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Adopt Py3.8+ features: Names for asyncio tasks · Issue #3733 · python-telegram-bot/python-telegram-bot

Adopt Py3.8+ features: Names for asyncio tasks #3733

New issue
Copy link
New issue
Copy link
Closed
💡 feature
#3759
Closed
Adopt Py3.8+ features: Names for asyncio tasks#3733
💡 feature
#3759
Copy link
Assignees
harshil21
Labels
📋 help-wantedwork status: help-wantedwork status: help-wanted

Description

@Bibo-Joshi
Bibo-Joshi
opened on Jun 2, 2023
Issue body actions

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.

Activity

  1. Bibo-Joshi
    added
    enhancement
    📋 help-wantedwork status: help-wantedwork status: help-wanted
    on Jun 2, 2023
  2. Trifase commented on Jun 4, 2023

    @Trifase
    Trifase
    on Jun 4, 2023
    Contributor
    More actions

    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?

  3. Bibo-Joshi commented on Jun 6, 2023

    @Bibo-Joshi
    Bibo-Joshi
    on Jun 6, 2023
    MemberAuthor
    More actions

    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 :)

    Reacted by Harshil
  4. harshil21
    self-assigned this
    on Jun 13, 2023
  5. harshil21
    linked a pull request that will close this issuePass `name` to `asyncio.create_task` #3759on Jun 17, 2023
  6. Bibo-Joshi
    closed this as completedon Jun 29, 2023
  7. github-actions
    locked and limited conversation to collaborators on Jul 7, 2023
  8. Bibo-Joshi
    removed
    enhancement
    on Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @harshil21
    harshil21

Labels

📋 help-wantedwork status: help-wantedwork status: help-wanted

Type

💡 feature

Fields

Priority

None yet

Effort

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402520 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.