Difference between union() and union_update() in sets, and others?
问题 Python sets have these methods: s.union(t) s | t new set with elements from both s and t s.update(t) s |= t return set s with elements added from t Likewise, there's also these: s.intersection_update(t) s &= t return set s keeping only elements also found in t s.intersection(t) s & t new set with elements common to s and t And so on, for all the standard relational algebra operations. So...question is, what exactly is the difference here? I see that it says that the update() versions returns