Commit a53278ac authored by Daniel Silverstone's avatar Daniel Silverstone Node.__contains__: Support this now

Now that we've had the fallout settle, support `key in somenode` again.
Signed-off-by: Daniel Silverstone's avatarDaniel Silverstone <>
parent a3fe0a4c
......@@ -63,8 +63,10 @@ from ._exceptions import LoadError, LoadErrorReason
class Node(namedtuple('Node', ['value', 'file_index', 'line', 'column'])):
def __contains__(self, what):
assert False, \
"BUG: Attempt to do `{} in {}` test".format(what, self)
# Delegate to the inner value, though this will likely not work
# very well if the node is a list or string, it's unlikely that
# code which has access to such nodes would do this.
return what in self[0]
# File name handling
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment