News for hackers. Stuff that matters.
Re:Dictionary union (PEP 584) is merged by anonymoushn on Tuesday February 25, 2020 @10:19PM (#22419983)
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).
Re:Dictionary union (PEP 584) is merged by CameronNemo on Tuesday February 25, 2020 @11:29PM (#22420280)
Not sure about the set operator, but this operator is meant to handle subclasses better than the status quo.
Re:Dictionary union (PEP 584) is merged by mdrachuk on Wednesday February 26, 2020 @12:55AM (#22420664)
Wow, one more point for python 3.

Just override ‘__and__’ in your whatever class to replace default return.

Pretty explicit in my book.