Skip to content

[Discussion] kwargs for input-only classes (like InputMedia*) #2607

@Bibo-Joshi

Description

@Bibo-Joshi

There are some TG classes that are used for input only, but where we still accept kwargs - which is mainly intended for the classes that we de-json TG data. This sometimes leads to confusion like here https://t.me/pythontelegrambotgroup/503803 b/c additional arguments are silently ignored.

This is somehow the same problem as in #1924.

I see three possible ways to proceed with this:

  1. keep **kwargs and do nothing
  2. Drop **kwargs for classes that are exclusively used for input. This has a minor risk of TG actually sending them back to us at some point …
  3. keep **kwargs but issue warnings when receiving unexpected arguments

I think we should at least try to apply any of the solutions consistently - not sure if that's currently the case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions