-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Move defaults to ext #2648
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
Merged
Merged
Move defaults to ext #2648
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ryptionError (#2621) * move telegramdecryptionerror to error.py * Change error class name
* feat: add docs about docs * fix: improve looks * fix: make link work * fix: this looks better * Improved markdown, updated link * Less justifying Co-authored-by: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com>
* Fix incomplete type annotations for CallbackContext Co-authored-by: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
* Feat: Custom pytest marker Co-authored-by: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com>
* Make basepersistence methods abstractmethod Signed-off-by: starry69 <starry369126@outlook.com> Co-authored-by: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
Co-authored-by: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
# Conflicts: # telegram/bot.py # telegram/ext/callbackqueryhandler.py # telegram/ext/chatmemberhandler.py # telegram/ext/choseninlineresulthandler.py # telegram/ext/commandhandler.py # telegram/ext/dispatcher.py # telegram/ext/handler.py # telegram/ext/inlinequeryhandler.py # telegram/ext/jobqueue.py # telegram/ext/messagehandler.py # telegram/ext/pollanswerhandler.py # telegram/ext/pollhandler.py # telegram/ext/precheckoutqueryhandler.py # telegram/ext/shippingqueryhandler.py # telegram/ext/stringcommandhandler.py # telegram/ext/stringregexhandler.py # telegram/ext/typehandler.py
…ryptionError (#2621) * move telegramdecryptionerror to error.py * Change error class name
* feat: add docs about docs * fix: improve looks * fix: make link work * fix: this looks better * Improved markdown, updated link * Less justifying Co-authored-by: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com>
* Fix incomplete type annotations for CallbackContext Co-authored-by: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
* Feat: Custom pytest marker Co-authored-by: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com>
* Make basepersistence methods abstractmethod Signed-off-by: starry69 <starry369126@outlook.com> Co-authored-by: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
Co-authored-by: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
# Conflicts: # telegram/bot.py # telegram/ext/dispatcher.py # telegram/ext/extbot.py # telegram/ext/jobqueue.py # tests/conftest.py
# Conflicts: # telegram/bot.py # telegram/ext/dispatcher.py # telegram/ext/extbot.py # telegram/ext/jobqueue.py # tests/conftest.py # tests/test_bot.py
# Conflicts: # telegram/bot.py # telegram/ext/dispatcher.py # telegram/ext/extbot.py # tests/test_bot.py
harshil21
requested changes
Sep 27, 2021
harshil21
approved these changes
Oct 3, 2021
Poolitzer
approved these changes
Oct 3, 2021
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.
Yes, the changes look good to me as well. Gonna merge.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #2346
Mostly as discussed in the dev chat. Two things to emphasize:
I couldn't think of a cleaner way of making
Message._quote
work, especially without directly accessingbot.defaults
inMessage
Bot._insert_defaults_for_ilq_results
could theoretically be moved intoBot._insert_defaults
, but then we'd have toInlineQueryResult*
(which is more error prone than just accesing the attributes)DefaultValue(obj)
instance, replace it with the default value orobj
None
and if it is, delete the key from the dictBecause of this it seemed a little cleaner to me to keep
Bot._insert_defaults_for_ilq_results
It's not really the job of
Bot._post
to convert datetime -> timestamp. Putting it there allows forExtBot
to easily override the behavior without having to override all the methods that accept adatetime
. An alternative would be to introduce aBot._dtm_to_timestamp
method that we call in the methods and thatExtBot
can overrideChecklist for PRs
.. versionadded:: version
,.. versionchanged:: version
or.. deprecated:: version
to the docstrings for user facing changes (for methods/class descriptions, arguments and attributes)