Skip to content

[red-knot] feat: add StringLiteral and LiteralString comparison#13634

Merged
carljm merged 10 commits intoastral-sh:mainfrom
Slyces:feat/str-comparison
Oct 5, 2024
Merged

[red-knot] feat: add StringLiteral and LiteralString comparison#13634
carljm merged 10 commits intoastral-sh:mainfrom
Slyces:feat/str-comparison

Conversation

@Slyces
Copy link
Contributor

@Slyces Slyces commented Oct 4, 2024

Summary

Implements string lietral comparisons and fallbacks to str instance for LiteralString.
Completes an item in #13618

Test Plan

  • Adds a dedicated test with non exhaustive cases

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Contributor

@carljm carljm left a comment

Choose a reason for hiding this comment

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

Looks great! I think we need a few more tests, in one case to catch a bug that also needs fixing, and in the other just for completeness.

@Slyces Slyces force-pushed the feat/str-comparison branch from 10408e9 to 5190a3f Compare October 5, 2024 16:54
@Slyces Slyces requested a review from carljm October 5, 2024 16:54
@Slyces Slyces force-pushed the feat/str-comparison branch from e259ccf to 768a412 Compare October 5, 2024 17:16
@Slyces Slyces requested review from AlexWaygood and carljm October 5, 2024 17:57
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

You need to switch to using the new APIs you introduced an hour ago in 1c2cafc ;)

@Slyces Slyces force-pushed the feat/str-comparison branch from 1f97dc5 to 171302b Compare October 5, 2024 18:10
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

LGTM

@carljm carljm merged commit 8108f83 into astral-sh:main Oct 5, 2024
@Slyces Slyces deleted the feat/str-comparison branch October 5, 2024 19:28
@MichaReiser MichaReiser added the ty Multi-file analysis & type inference label Oct 7, 2024
sharkdp added a commit that referenced this pull request Oct 14, 2024
Implements inference for `BytesLiteral` comparisons along the lines of
#13634.
sharkdp added a commit that referenced this pull request Oct 14, 2024
Implements inference for `BytesLiteral` comparisons along the lines of
#13634.

closes #13687
sharkdp added a commit that referenced this pull request Oct 14, 2024
Implements inference for `BytesLiteral` comparisons along the lines of
#13634.

closes #13687
sharkdp added a commit that referenced this pull request Oct 14, 2024
Implements inference for `BytesLiteral` comparisons along the lines of
#13634.

closes #13687
sharkdp added a commit that referenced this pull request Oct 14, 2024
Implements inference for `BytesLiteral` comparisons along the lines of
#13634.

closes #13687

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants