Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __repr__(self):
str_items = []
for item in self.items:
if isinstance(item.op, Dot) and item.op.key == item.key:
str_items.append(item.key)
else:
str_items.append('%s: %s' % (item.key, item.op))
return '{' + ', '.join(str_items) + '}'
key().setParseAction(lambda ts: ProjectionItem(ts[0], Dot(ts[0])))
).setName('projection_item')