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

Update code example to use "is not" in Static Typing #10085

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KleidonBD
Copy link
Contributor

Godot 4.3 added the ability to use "is not" instead of "not a is b" for improved readability. This code example should be updated to use the new feature to be more up to date with the latest version.

Also, the original line used parentheses in its conditional statement, which is explicitly against the style guide.

Godot 4.3 added the ability to use "is not" instead of "not a is b" for improved readability. This code snippet should be updated to use the new feature to be more up to date with the latest version.
@tetrapod00
Copy link
Contributor

tetrapod00 commented Oct 18, 2024

Duplicate of #9777 (although the older PR chooses to add another line to document is not rather than replacing the current one).

Copy link
Contributor

@tetrapod00 tetrapod00 left a comment

Choose a reason for hiding this comment

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

This seems like a fine change.

Using the is not keyword without first documenting is is a bit strange. But this note block is meant to document type casting, not the is keyword itself, and there are two other examples on this page that use the is keyword:

``is`` keyword and then declare a variable with the type ``MyScript`` on

property contains an object of the right type using the ``is`` keyword, and

Between this PR and #9777, I slightly prefer the other PR. But this one is good and does not need additional changes.

@KleidonBD
Copy link
Contributor Author

Completely understandable. Like you said, the keyword itself isn't the focus of the code block which is why I didn't feel the need to call attention to it. The main thing I sought to change was removing the parentheses to align with the GDScript style guide, and figured this would kill two birds with one stone.

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