Skip to content
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

Drop explicit type conversions in __init__ s #3056

Merged
merged 2 commits into from
May 26, 2022
Merged

Conversation

Bibo-Joshi
Copy link
Member

Addresses the second part of and closes #2901.

I double checked: numbers and strings are indeed different things in json, so this won't be a problem. My concerns in #2901 (comment) probably came from my subconscious recalling that keys can only be strings in json, which is why json.dumps({1: '1'}) == '{"1": 1}' and json.loads('{"1": 1}') == {"1": 1}.

This also makes RetryAfter.retry_after an integer b/c that's what TG documents (this is a tiny breaking change) and adds some missing docs to the error module.

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 this to the v20.0a1 milestone May 20, 2022
@Bibo-Joshi Bibo-Joshi merged commit 5e0bcfb into master May 26, 2022
@Bibo-Joshi Bibo-Joshi deleted the drop-type-conversions branch May 26, 2022 17:16
@github-actions github-actions bot locked and limited conversation to collaborators Jun 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handling of constraints and type conversions for Telegram classes and methods
2 participants