Skip to content

Conversation

@Bibo-Joshi
Copy link
Member

First part of #2698.

In this context also

  • gives TelegramObject a proper __init__ that's called in the subclasses
  • Removes all bot and **(_)kwargs arguments from the subclasses
  • moves calling set_bot from the subclasses __init__ to de_json

Documentation updates coming up soonish

Checklist for PRs

  • Added .. versionadded:: version, .. versionchanged:: version or .. deprecated:: version to the docstrings for user facing changes (for methods/class descriptions, arguments and attributes)
  • Created new or adapted existing unit tests
  • Documented code changes according to the CSI standard
  • Added myself alphabetically to AUTHORS.rst (optional)
  • Added new classes & modules to the docs and all suitable __all__ s

@Bibo-Joshi Bibo-Joshi added 🛠 refactor change type: refactor 🛠 breaking change type: breaking labels Sep 11, 2022
@Bibo-Joshi Bibo-Joshi added this to the v20.0a5 milestone Sep 11, 2022
@Bibo-Joshi Bibo-Joshi marked this pull request as ready for review September 11, 2022 12:07
@harshil21 harshil21 self-requested a review September 16, 2022 22:44
@Bibo-Joshi Bibo-Joshi mentioned this pull request Sep 18, 2022
8 tasks
Copy link
Member

@harshil21 harshil21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job, must have been tedious to change for all classes manually. Some observations:

  1. Should we make the api_kwargs argument private in all classes since it's not documented?
  2. Review related: Missing versionchanged doc for many inlinequery classes, I marked 2 of them. See review comment no. 21 first.
  3. test_official should be updated too.

Btw do you want to also do #3146 in this or another PR?

@harshil21 harshil21 added the ℹ️ needs-wiki-update information: needs-wiki-update label Sep 24, 2022
@Bibo-Joshi
Copy link
Member Author

Sorry, forgot to reply on this 🙈

  1. Should we make the api_kwargs argument private in all classes since it's not documented?

IISC We usually don't re-document parameters of the parent class 🤔 I wouldn't consider it private.

  1. test_official should be updated too.

What needs updating here?

Btw do you want to also do #3146 in this or another PR?

That's rather independent IMO. I'm not planning on doing that in this PR

@harshil21
Copy link
Member

IISC We usually don't re-document parameters of the parent class 🤔 I wouldn't consider it private.

Oops, forgot that this is documented in TGObject

What needs updating here?

only the _kwargs and kwargs in this variable

That's rather independent IMO. I'm not planning on doing that in this PR

alright

Copy link
Member

@harshil21 harshil21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, the new tests give more confidence that it works.

Also just realized (sorry should've noticed sooner), but shouldn't we make api_kwargs keyword only to better match the behaviour we have for bot methods api_kwargs?

Copy link
Member

@harshil21 harshil21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! LGTM

Copy link
Member

@Poolitzer Poolitzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went through them, great change, looks good to me!

# Conflicts:
#	telegram/ext/_extbot.py
@Bibo-Joshi Bibo-Joshi merged commit 1c20ff3 into master Oct 7, 2022
@Bibo-Joshi Bibo-Joshi deleted the TO-overhaul branch October 7, 2022 09:51
@github-actions github-actions bot locked and limited conversation to collaborators Oct 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

🛠 breaking change type: breaking ℹ️ needs-wiki-update information: needs-wiki-update 🛠 refactor change type: refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants