[New-bugs-announce] [issue17854] symmetric difference operation applicable to more than two sets
Amit Saha
report at bugs.python.org
Sat Apr 27 13:47:20 CEST 2013
New submission from Amit Saha:
The description of the symmetric difference operation implies that it cannot be applied to more than two sets (http://docs.python.org/3/library/stdtypes.html#set.symmetric_difference).
However, this is certainly possible:
>>> s={1,2}
>>> t={2,3}
>>> u={3,4}
>>> s^t^u
{1, 4}
>>> s.symmetric_difference(t).symmetric_difference(u)
{1, 4}
I am not sure how much of a "semantic" sense that makes, given that symmetric difference is by definition for two sets. (http://en.wikipedia.org/wiki/Symmetric_difference).
So, either the operator should be fixed to allow only two sets or the description be updated.
----------
assignee: docs at python
components: Documentation
messages: 187899
nosy: Amit.Saha, docs at python
priority: normal
severity: normal
status: open
title: symmetric difference operation applicable to more than two sets
type: behavior
versions: Python 3.3
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17854>
_______________________________________
More information about the New-bugs-announce
mailing list