- Notifications
You must be signed in to change notification settings - Fork5.7k
refactor: add enum constants#3351
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
* add constants for `max_connections`* expand docstring for `secret_token`
* add limits for heading* add minimum proximity_alert_radius(as it is non-zero)* fix docstrings that link to HEADINGconstant twice instead of PROXIMITY_ALERT_RADIUS(and hence 360 was displayed instead of 100000)
This is not part of the code I'm changing, but I was just creating a class with limits for |
BTW, class |
This comment was marked as resolved.
This comment was marked as resolved.
* add links to/from `InlineQueryResultLocation` and `InputLocationMessageContent`that were not added in previous commits* note that `Location` class does not havelimits specified for `live_period` and`proximity_alert_radius` but `InlineQueryResultLocation`and `InputLocationMessageContent` do
lemontree210 left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
I remember that adding class constants toBot
is not optimal, but shouldn't I fully implement the approachlaid out in description for#3107 inDice
? Which would mean introducing class constants foremoji
andvalue
inDice
class directly and linking them toconstants.py
.
+ make sure the order of constants is kept in docs
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.
you're being thorough, nice! :)
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
note that this approach leads to similar constantsin multiple classes
Typo: "Minimum" instead of "Maximum"
reverting changes made to telegram.dice.rstincbe20e6
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Do you think I should also replace "emoji literals" in |
these are allowed lengths of strings, not allowed values
use existing class `BotCommandLimit`
minimum length is only specified in 1 class and 1 method
lemontree210 commentedNov 20, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Savingcomments by@Bibo-Joshi here: I vote to keep Putting title limits into a I also vote to keep the current
|
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
* InlineQueryResultContact* InputContactMessageContent
This comment was marked as outdated.
This comment was marked as outdated.
@@ -93,3 +106,45 @@ def __init__(self, value: int, emoji: str, *, api_kwargs: JSONDict = None): | |||
""" |
lemontree210Nov 21, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
This comment is about the lines above this one. I didn't add any.. versionadded
to class constants that I didn't create, though I think this needs to be done. I also think that the version marking in the line immediately above this one (forBOWLING
) might be wrong: a bowling emoji was added in 13.4, but the constant itself is being introduced in 20.0. So maybe all constants referring toDiceEmoji
should also get the20.0
marking.
(Since I wasn't changing those lines, I couldn't add a comment to them directly)
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.
This PR is very high effort and simply insane. It was excruciating for me to just review over the past few days! Well done!
# Conflicts:#telegram/_bot.py#telegram/constants.py
Uh oh!
There was an error while loading.Please reload this page.
Addresses#3107. This PR replaces#3336 that was a PR from my own fork. Instead, now it's a PR within the repository.
constants.py
::paramref:
s.. versionadded:: 20.0
to every added constant in "target" classes (e.g. like it's done for class constants inInlineQuery
)