Issue 6573: Fix set.union() for cases where self is in the argument chain.
diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py
index 872e9ea..bc7465a 100644
--- a/Lib/test/test_set.py
+++ b/Lib/test/test_set.py
@@ -81,6 +81,10 @@
self.assertEqual(self.thetype('abcba').union(C('ef')), set('abcef'))
self.assertEqual(self.thetype('abcba').union(C('ef'), C('fg')), set('abcefg'))
+ # Issue #6573
+ x = self.thetype()
+ self.assertEqual(x.union(set([1]), x, set([2])), self.thetype([1, 2]))
+
def test_or(self):
i = self.s.union(self.otherword)
self.assertEqual(self.s | set(self.otherword), i)