Skip to content

[Type Hinting] _log function is not properly annotated #4010

@DavidEGx

Description

@DavidEGx

Steps to Reproduce

  1. Create a test.py like:
import asyncio
import telegram

bot = telegram.Bot(token="some-token")
async def send_msg():
    await bot.send_message(chat_id="channel-id", text="Hello World")  # Argument missing for parameter "self"

asyncio.run(send_msg())
  1. Run
pyright test.py

You'll see:

test.py:6:11 - error: Argument missing for parameter "self" (reportGeneralTypeIssues)

Fix is described in pyright discussion, see microsoft/pyright#6669 (comment)

Expected behaviour

Code is properly annotated so pyright doesn't throw any error.

Actual behaviour

Pyright complains Argument missing for parameter "self"

Operating System

Ubuntu 23.10

Version of Python, python-telegram-bot & dependencies

python-telegram-bot 20.7
Bot API 6.9
Python 3.11.6 (main, Oct  8 2023, 05:06:43) [GCC 13.2.0]

Relevant log output

No response

Additional Context

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions