3 ms·
Note that a | b is already a disaster if you try to use subclasses of set. In python 2.7, iirc it would return a set of a's type but without calling the constru
by anonymoushn 7y ago
Note that a | b is already a disaster if you try to use subclasses of set. In python 2.7, iirc it would return a set of a's type but without calling the constructor. In python 3 it seems to return a set (not the type of a or the type of b).
- CameronNemo 7y agoNot sure about the set operator, but this operator is meant to handle subclasses better than the status quo.
- mdrachuk 7y agoWow, one more point for python 3. Just override ‘__and__’ in your whatever class to replace default return. Pretty explicit in my book.