Skip to content

gh-131798: JIT: Assign type to sliced string #133609

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

fluhus
Copy link
Contributor

@fluhus fluhus commented May 7, 2025

Slicing a string always returns a string.
Make the optimizer assign a string type to the result of slicing a string.

Follow up to-do: apply this to lists and tuples too.

@brandtbucher

Copy link
Contributor

@sharktide sharktide left a comment

Choose a reason for hiding this comment

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

This is a user-facing change. This probably needs a NEWS entry

*sorry, this isn't a user-facing change. I was tired and not thinking straight. But still would be best for a news entry

@brandtbucher
Copy link
Member

This isn’t a user-facing change (but a NEWS entry doesn’t hurt).

@sharktide
Copy link
Contributor

sharktide commented May 8, 2025

This isn’t a user-facing change (but a NEWS entry doesn’t hurt).

sorry, did I type that? my brain wasn't working. Yes, you're right, a news entry would be best here and this isn't a user facing change.

Comment on lines +1100 to +1102
// Slicing a string always returns a string.
// TODO: We can apply this to lists and tuples as well.
// We'll start with string to simplify the process.
Copy link
Member

Choose a reason for hiding this comment

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

Wanna just add the others to this PR too? It's just two lines here and a couple of tests.

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

Successfully merging this pull request may close these issues.

3 participants