All your sets contain the same number of elements: they all contain exactly one element. However they contain elements of different types, which is why you can't compare. Namely x
contains a 3-tuple (char * char * char
), y
contains a 4-tuple and z
contains a 5 tuple.
The important thing to note here is that Add('a', 'b', 'c')
doesn't call Add
with multiple arguments - it calls it with one argument, which is a tuple. This will add a single tuple element to the set. To add multiple elements, use Add
multiple times or just use the set
on a list (i.e. set ['a'; 'b'; 'c']
) instead of Add
to avoid multiple function calls.