godot: Parsing error when using 'not in'

line 19 always gives me an error(19,19): ‘:’ expected at the end of line

if component.type() not in database.keys():

This happens in everything I have tried not in with code wise. A helpful forum user pointed out another way to make it work http://godotengine.org/topics/14086 but I feel like this should be correct usage. entitymanager.gd.txt

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 5
  • Comments: 16 (10 by maintainers)

Most upvoted comments

I would add is not too if we’re going that route.

Maybe with isn't as syntactic sugar? 😛

I would add is not too if we’re going that route.

The not in operator exists in Python but indeed not in GDScript. As to whether it should be implemented, I don’t have any strong opinion. As @Faustabov pointed it out, using not thing in list already works fine, so the gain of supported not in directly would likely be minimal and add some complexity to the parser.