I've noticed that I can update() a set with a list but I can't extend a set
with a list using the |= assignment operator.
set([1, 2, 3])>>s = set()
s.update([1,2,3])
s
Traceback (most recent call last):>>s |= [4,5,6]
File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for |=: 'set' and 'list'
set([1, 2, 3, 4, 5, 6])>>s |= set([4,5,6])
s
Why is that? Doesn't the |= operator essentially map to an update() call?
Skip