Why does a^=b throw an error when a=a^b does not?
Why does a^=b throw an error when a=a^b does not? Question: My class’ xor function is working as intended but when doing a^=b, I get ‘TypeError: unsupported operand type(s) for ^=: ‘NoneType’ and ‘Multiset.” Relevant code below: def __xor__(self,o): d=Multiset() #subclass of dict for x in self|o: #for each item in both multisets m=abs((self[x] if …