A syntactic construct which provides a concise way to create sets in a style similar to the mathematical set-builder notation.
Set comprehensions can be used to construct sets in one line. For simple tasks, a set comprehension may be more readable than sets built using looping constructs.
Set comprehensions tend to consist of an input sequence of either a list, a dictionary or a tuple, variable bindings, filtering predicates and an output expression.
Set comprehensions are very similar to list comprehensions.