Python set comprehension: Unique items from nested iterables

Python set comprehension: Unique items from nested iterables

In Python 3.15, get the unique elements in a list of iterables with the new in-comprehension unpacking syntax to create a set comprehension:

x = [[10, 20], [20, 30, 40], [40, 50, 60]]

{*n for n in x} # returns {10, 20, 30, 40, 50, 60}