Skip to content

Comments

Add as_slice method for all string nodes#9111

Merged
dhruvmanila merged 2 commits intomainfrom
dhruv/as-slice
Dec 13, 2023
Merged

Add as_slice method for all string nodes#9111
dhruvmanila merged 2 commits intomainfrom
dhruv/as-slice

Conversation

@dhruvmanila
Copy link
Member

This PR adds a as_slice method to all the string nodes which returns all the parts of the nodes as a slice. This will be useful in the next PR to split the string formatting to use this method to extract the single node or implicitly concanated nodes.

This method returns all the parts of an implicitly concatenated string
as a slice. If it's not implicitly concatenated, it'll return a slice
with a single element.
@dhruvmanila
Copy link
Member Author

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

@dhruvmanila dhruvmanila added the internal An internal refactor or improvement label Dec 13, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Dec 13, 2023

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@dhruvmanila dhruvmanila enabled auto-merge (squash) December 13, 2023 06:26
@dhruvmanila dhruvmanila merged commit 18452cf into main Dec 13, 2023
@dhruvmanila dhruvmanila deleted the dhruv/as-slice branch December 13, 2023 06:31
mdbernard pushed a commit to mdbernard/ruff that referenced this pull request Dec 18, 2023
This PR adds a `as_slice` method to all the string nodes which returns
all the parts of the nodes as a slice. This will be useful in the next
PR to split the string formatting to use this method to extract the
_single node_ or _implicitly concanated nodes_.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal An internal refactor or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants