Skip to content

Make use of @final, Final and Literal - #3753

Merged
Bibo-Joshi merged 3 commits into
drop-py-37from
py-3.8-typing
Jun 17, 2023
Merged

Make use of @final, Final and Literal#3753
Bibo-Joshi merged 3 commits into
drop-py-37from
py-3.8-typing

Conversation

@Bibo-Joshi

Copy link
Copy Markdown
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 affected functionality: type-hinting πŸ”— python related technology: python labels Jun 12, 2023

@lemontree210 lemontree210 left a comment

Copy link
Copy Markdown
Member

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

Comment thread telegram/_update.py Outdated
Comment thread telegram/ext/_applicationbuilder.py Outdated
@Bibo-Joshi
Bibo-Joshi requested a review from lemontree210 June 15, 2023 20:15
@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
@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 related technology: python βš™οΈ type-hinting affected functionality: type-hinting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants