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

String.get_slice return Raw String #78459

Closed
CsloudX opened this issue Jun 20, 2023 · 3 comments · Fixed by #78463
Closed

String.get_slice return Raw String #78459

CsloudX opened this issue Jun 20, 2023 · 3 comments · Fixed by #78463
Assignees
Milestone

Comments

@CsloudX
Copy link

CsloudX commented Jun 20, 2023

Godot version

v4.1.beta2.official [a2575cb]

System information

Windows 10, 64bit

Issue description

image
String.get_slice() returns an raw string if the slice does not exist, but the docs say:
image

Steps to reproduce

/

Minimal reproduction project

/

@AThousandShips
Copy link
Member

The documentation is arguably ambiguous here, it doesn't exactly state that it will return empty if no entry matches, only if the specific slice doesn't exist, so it's a matter of interpretation here, and arguably changing the code breaks compatibility, depending on the interpretation, so we can either clarify the documentation or update the code, the former is easier and safer

@timothyqiu
Copy link
Member

get_slice() was an internal method and exposed later in #54453. The behavior is the same at that time, so it's the documentation that's wrong.

@AThousandShips
Copy link
Member

It's been the same since before open source

Will update the documentation

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

Successfully merging a pull request may close this issue.

3 participants