A value can be repeated more than once in a dictionary, but not in a set. Therefore, returning an array returns all values, and returning a set returns only unique values.
The keys, of course, must be unique, so I would suggest that the choice of the array, and not the set, be simple consistency.
source
share