class MySet(set):
def showme(self):
print(self)
s1 = MySet([1, 2, 3])
s2 = MySet([2, 3, 4])
(s1&s2).showme()
should output:
{2, 3}
The problem is, that the operators return an instance of set, which lacks all of the stuff, that I added to it in my subclass. I know, I could override all methods, that retun "self" and wrap "self" into "MySet(self)". I want to void this, if possible and it would be ideal if this worked when using the operators on a MySet() & set()