I don’t think guarding against specific use cases is more a hack. In the end, you’ll have many funny effects with this type of logic. If you add something to a set, do you expect the exact object to be in the set afterwards? In the end, one would need to think about whether having the Python interface be Pythonic is a goal.