Skip to content

Add comparison to str#136

Open
lsbrillant wants to merge 2 commits intopydantic:mainfrom
lsbrillant:main
Open

Add comparison to str#136
lsbrillant wants to merge 2 commits intopydantic:mainfrom
lsbrillant:main

Conversation

@lsbrillant
Copy link

Add str comparison support.
bringing higher feature parity with base python.

Add str comparison support.
bringing higher feature parity with base python.
@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/monty/src/types/str.rs 0.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 10, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing lsbrillant:main (46605d0) with main (20d9d27)

Summary

✅ 13 untouched benchmarks

Copy link
Member

@samuelcolvin samuelcolvin left a comment

Choose a reason for hiding this comment

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

otherwise LGTM

assert s[False] == 'a', 'str getitem with False'
assert s[True] == 'b', 'str getitem with True'

# Sorting and comparisons
Copy link
Member

Choose a reason for hiding this comment

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

we should add a test for non-ascii strings and strings of different lengths - I have no idea if python's string comparison logic is the same as Rust's

@samuelcolvin
Copy link
Member

Also, any m what about bytes?

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