S
skip
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.
Why is that? Doesn't the |= operator essentially map to an update() call?
Skip
with a list using the |= assignment operator.
Traceback (most recent call last):>>> s = set()
>>> s.update([1,2,3])
>>> s set([1, 2, 3])
>>> s |= [4,5,6]
set([1, 2, 3, 4, 5, 6])File said:>>> s |= set([4,5,6])
>>> s
Why is that? Doesn't the |= operator essentially map to an update() call?
Skip