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

Make use of @final, Final and Literal #3753

Merged
merged 3 commits into from Jun 17, 2023
Merged

Make use of @final, Final and Literal #3753

merged 3 commits into from Jun 17, 2023

Conversation

Bibo-Joshi
Copy link
Member

Closes #3735

  • Mostly changes ClassVar to Final for all constants
  • Adds some limited usage of the @final decorator for Base{UpdateProcessor, Request}
  • Uses Literal for the http_version argument of HTTPXRequest. Otherwise, Literal is not used due to Literal of enum values python/typing#781

If there are more places, where @final or Literal are useful, please do point them out :)

@Bibo-Joshi Bibo-Joshi added type hinting Not bug. Not Docs. But both. python labels Jun 12, 2023
Copy link
Member

@lemontree210 lemontree210 left a comment

Choose a reason for hiding this comment

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

I don't have the required in-depth knowledge to suggest more cases of @final that may have been missed

telegram/_update.py Outdated Show resolved Hide resolved
telegram/ext/_applicationbuilder.py Outdated Show resolved Hide resolved
@harshil21 harshil21 added this to the v20.4 milestone Jun 16, 2023
@Bibo-Joshi Bibo-Joshi merged commit 9181369 into drop-py-37 Jun 17, 2023
19 checks passed
@Bibo-Joshi Bibo-Joshi deleted the py-3.8-typing branch June 17, 2023 07:11
@github-actions github-actions bot locked and limited conversation to collaborators Jun 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
python type hinting Not bug. Not Docs. But both.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants