[New-bugs-announce] [issue6573] set union method ignores arguments appearing after the original set

Shawn Smout report at bugs.python.org
Sat Jul 25 17:24:21 CEST 2009


New submission from Shawn Smout <silroquen at yahoo.com>:

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,

frozenset().union(frozenset([1]), frozenset(), frozenset([2]))

also evaluates to just frozenset([1]).

The fix is trivial, so I'm attaching a patch.

----------
files: set_union.patch
keywords: patch
messages: 90925
nosy: ssmout
severity: normal
status: open
title: set union method ignores arguments appearing after the original set
Added file: http://bugs.python.org/file14565/set_union.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6573>
_______________________________________


More information about the New-bugs-announce mailing list