class MySet(set): def showme(self): print(self) s1 = MySet([1, 2, 3]) s2 = MySet([2, 3, 4]) (s1&s2).showme()
should output:
{2