What does |= (ior) do in Python?

|= performs an in-place+ operation between pairs of objects. In particular, between: sets: a union operation dicts: an update operation counters: a union (of multisets) operation numbers: a bitwise OR, binary operation In most cases, it is related to the | operator. See examples below. Sets For example, the union of two assigned sets s1 … Read more