➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
标题: set union method ignores arguments appearing after the original set
类型: Stage:
Components: Versions: Python 3.1, Python 3.2, Python 2.7, Python 2.6
process
状态: closed Resolution: fixed
Dependencies: 后续:
分配给: rhettinger 抄送列表: rhettinger, ssmout
优先级: high 关键字: patch

Created on 2009-07-25 15:24 by ssmout, last changed 2022-04-11 14:56 by admin. This issue is now closed.

文件
文件名 上传时间 Description 编辑
set_union.patch ssmout, 2009-07-25 15:24 fix
Messages (3)
msg90925 - (view) Author: Shawn Smout (ssmout) 日期: 2009-07-25 15:24
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.
msg90987 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) 日期: 2009-07-27 17:41
Good catch.  Thanks.
msg90997 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) 日期: 2009-07-27 20:33
Fixed.  See r74226, r74227, r74228 and r74229.
历史
日期 用户 动作 参数
2022-04-11 14:56:51admin修改github: 50822
2009-07-27 20:33:44rhettinger修改状态: open -> closed
resolution: fixed
消息: + msg90997

versions: + Python 2.6, Python 3.1, Python 2.7, Python 3.2
2009-07-27 17:41:58rhettinger修改优先级: high

消息: + msg90987
2009-07-25 15:26:03benjamin.peterson修改assignee: rhettinger

抄送: + rhettinger
2009-07-25 15:24:20ssmout创建