Equivalent of this inventory_hostname in groups['dev'] or inventory_hostname in groups['lb']

Is there a shortcut way for this?
inventory_hostname in groups[‘dev’] or inventory_hostname in groups[‘lb’]
I have a long playbook, im trying to cut some text.

There are a number of alternatives

inventory_hostname in (groups.dev + groups.lb)

inventory_hostname in lookup(‘inventory_hostnames’, ‘dev:lb’)

[‘dev’, ‘lb’]|intersection(group_names)