You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
set union method ignores arguments appearing after the original set #50822
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/rhettinger'closed_at=<Date2009-07-27.20:33:44.642>created_at=<Date2009-07-25.15:24:20.292>labels= []
title='set union method ignores arguments appearing after the original set'updated_at=<Date2009-07-27.20:33:44.628>user='https://bugs.python.org/ssmout'
When calling the union method of a set with several arguments, if one of
those sets is the original set, all arguments appearing after it are
ignored. For example:
x=set()
x.union(set([1]), x, set([2]))
evaluates to set([1]), not set([1, 2]) as expected. As another example,
since all empty frozensets are the same,
Activity
ssmout commentedon Jul 25, 2009
When calling the union method of a set with several arguments, if one of
those sets is the original set, all arguments appearing after it are
ignored. For example:
evaluates to set([1]), not set([1, 2]) as expected. As another example,
since all empty frozensets are the same,
frozenset().union(frozenset([1]), frozenset(), frozenset([2]))
also evaluates to just frozenset([1]).
The fix is trivial, so I'm attaching a patch.
rhettinger commentedon Jul 27, 2009
Good catch. Thanks.
rhettinger commentedon Jul 27, 2009
Fixed. See r74226, r74227, r74228 and r74229.