As the documentation for size
tells you,
Return a tuple containing the dimensions of A.
the set has no dimensions (shape), so size
is not the right abstraction. length
will always give you the number of elements, and for that reason it applies to Set
.