Consider this example:
In [44]: exl_set = set(a.node)
In [45]: exl_set
Out[45]: set(['1456030', '-9221969'])
In [46]: exl_set.add(b.node)
In [47]: exl_set
Out[47]: set(['1456030', ('-9227619', '1458170'), '-9221969'])
What is the best way to add tuples
of length 2 to a set
without breaking them apart with the first add
? The result should look like this:
Out[48]: set([ ('-9221969','1456030'),('-9227619', '1458170')])