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

style: Mark Empty and CACHE_FOREVER as @typing.final #1959

Merged
merged 2 commits into from
Jul 15, 2023

Conversation

sobolevn
Copy link
Member

Pull Request Checklist

  • New code has 100% test coverage
  • (If applicable) The prose documentation has been updated to reflect the changes introduced by this PR
  • (If applicable) The reference documentation has been updated to reflect the changes introduced by this PR

Description

mypy soon will have special narrowing for @final singleton types: python/mypy#15646

So, it is a good idea to use @final for such types.

mypy soon will have special narrowing for `@final` singleton types: python/mypy#15646

So, it is a good idea to use `@final` for such types.
@sobolevn sobolevn requested a review from a team as a code owner July 15, 2023 09:27
@provinzkraut
Copy link
Member

mypy soon will have special narrowing for @Final singleton types

Cool, didn't know about this special support!

Copy link
Member

@provinzkraut provinzkraut left a comment

Choose a reason for hiding this comment

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

We should apply this to CACHE_FOREVER here as well:

class CACHE_FOREVER: # noqa: N801

@provinzkraut provinzkraut changed the title style: Empty placeholder type should be @final style: Mark Empty and CACHE_FOREVER as @typing.final Jul 15, 2023
@provinzkraut provinzkraut merged commit 9559533 into litestar-org:main Jul 15, 2023
@github-actions
Copy link

Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/1959

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants