Skip to content

Type-hinting for IDEs #1373

@TiiFuchs

Description

@TiiFuchs

Hi there,

I like to use the Message.reply_* functions but it's kind of annoying to always look up the parameters manually. There is a lack of type-hinting here. And with python stub files (or type hinting in the python files directly this would not be a problem at all.

The Problem is, if I have a update instance and I call update.message it doesn't know that this is a Message instance. If I tell my IDE using message = update.message # type: Message it works so far. But when I then type message.reply_text( there is no type-hinting (or variable hinting for that matter) for the named parameters. This is annoying.

I started to create python stub files like this:
message-type-hint

But it would be awesome if type-hinting a la PEP-484 would be integrated in the project itself.

I know that python 2 compatibility (at least until EOL) is still a thing, but type-hinting with comments like described above (and at some place in PEP-484) is always possible for both python versions.
update-type-hint

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions