-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Make telegram.Bot comparable #2320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: starry69 <starry369126@outlook.com>
Signed-off-by: starry69 <starry369126@outlook.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mh, actually you're right about self.get_me()
already setting self._bot
, but imo it's still more readible to assign the return value anyway.
Some more notes:
- Please document that bot is now comparable (See e.g. here) probably just do it als
.. versionadded:: 13.2 Objects of this class …
- After a closer look the tests fail b/c some tests want to monkeypatch
bot.bot
, which is no longer possible. Ig just making them patchbot._bot
instead should be fine - Some other tests fail, b/c
Bot
is no longer hashable.Bot.__hash__
should returnhash(self.bot)
, as that's what we're comparing with. see here - For what the equality tests should look like please see here
Signed-off-by: starry69 <starry369126@outlook.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates! Just two comments left :)
Closes #2319