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

fix: remove OptionalSequence helper type. #2370

Merged
merged 6 commits into from
Sep 27, 2023
Merged

Conversation

peterschutt
Copy link
Contributor

@peterschutt peterschutt commented Sep 27, 2023

This PR corrects cases where we have types annotated as OptionalSequence[T] | None by removing the OptionalSequence helper type.

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

Close Issue(s)

@peterschutt peterschutt requested review from a team as code owners September 27, 2023 05:42
Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

I would advocate to remove OptionaSequence at some point for two reasons:

  1. Custom type aliases for common types are harder to read (I guess that OptionalSequence is Sequence[T] | None
  2. Optional is longer than | None :)

@peterschutt
Copy link
Contributor Author

I would advocate to remove OptionaSequence at some point for two reasons:

1. Custom type aliases for common types are harder to read (I guess that `OptionalSequence` is `Sequence[T] | None`

2. `Optional` is longer than `| None` :)

Agreed. This is likely just cruft leftover from before we added __future__.annotations.

This PR corrects cases where we have types annotated as `OptionalSequence[T] | None` by removing the `OptionalSequence` helper type.
@peterschutt peterschutt changed the title fix: remove OptionalSequence[T] union with None. fix: remove OptionalSequence helper type. Sep 27, 2023
@peterschutt peterschutt force-pushed the optional-sequence-usage branch from d9eee9d to 95018a3 Compare September 27, 2023 07:57
@peterschutt peterschutt enabled auto-merge (squash) September 27, 2023 10:03
@sonarcloud
Copy link

sonarcloud bot commented Sep 27, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@github-actions
Copy link

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

@peterschutt peterschutt merged commit 7250cc1 into main Sep 27, 2023
17 checks passed
@peterschutt peterschutt deleted the optional-sequence-usage branch September 27, 2023 10:28
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.

5 participants