Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Make use of @final, Final and Literal #3753

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 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 affected functionality: type-hinting 🔗 python related technology: 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

@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