Describe the project you are working on:
This issue works for all projects that use the keywords "in" and "is"
Describe the problem or limitation you are having in your project:
When trying to use the opposite of "in" and "is", most people, especially the people who have used Python before would use "a not in b" and "a is not b" instead of "not a in b" and "not a is b". In Python, both the former and latter example works, but in GDScript only the latter is valid syntaxes.
Describe the feature / enhancement and how it helps to overcome the problem or limitation:
Just allow usage of "a not in b" and "a is not b", which not only are in Python but also make sense grammatically
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
a is not b #equivalent to not a is b
a not in b #equivalent to not a in b
If this enhancement will not be used often, can it be worked around with a few lines of script?:
The keywords themselves should be used quite oftenly, but yes its easy to have a work around.
Is there a reason why this should be core and not an add-on in the asset library?:
It's a simple quality of life improvement that is pretty straightforward to implement and helps with the workload a lot.
Previous discussion: godotengine/godot#3677
"in" does not exist to my knowledge, unless this was newly added in 4.0. It also is a bit extreme to add, given that if not thing.has(thing): is already pretty grammatically correct.
And I don't see why we need a whole addition to the language just to have the occasional line be a little bit more correct in English.
I do not want a is not b and I dislike that part of python, it makes boolean expressions more confusing by trying to hide/muddy the fact that they are boolean
The most intuitive parsing of it is a is (not b) which rarely makes sense unless a and b are bools.
Trying to shoehorn natural english into expressions like this is a huge mistake in my opinion
I would be less opposed to an isnt-operator, like a isnt b but that would be incredibly obscure and probably not worth it.
"in" does not exist to my knowledge, unless this was newly added in 4.0. It also is a bit extreme to add, given that
if not thing.has(thing):is already pretty grammatically correct.And I don't see why we need a whole addition to the language just to have the occasional line be a little bit more correct in English.
It does, I'm currently using 3.2.2 Stable
Note that is in gdscript is not equivalent to is in python. The former is a type check, the latter is an identity check.
I would suggest splitting this into two proposals:
allow is not: this has the boolean ambiguity mentioned by @Meriipu but is is probably very rare in gdscript anyway with as automatically returning null. Note that for both python and gdscript semantics a is (not b) is almost certainly a bug. And I personally think allowing the more natural meaning proposed here would be a good thing, but I won't shed a tear if it doesn't happen.
allow not in: currently a syntax error, so no ambiguity. Should be less controversial. I write this all the time out of habit, and I think it would be a great addition. I'd also be prepared to look into making it happen.
Most helpful comment
It does, I'm currently using 3.2.2 Stable