Message187899
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. |
|
Date |
User |
Action |
Args |
2013-04-27 11:47:20 | Amit.Saha | set | recipients:
+ Amit.Saha, docs@python |
2013-04-27 11:47:20 | Amit.Saha | set | messageid: <1367063240.22.0.643670001227.issue17854@psf.upfronthosting.co.za> |
2013-04-27 11:47:20 | Amit.Saha | link | issue17854 messages |
2013-04-27 11:47:19 | Amit.Saha | create | |
|