Author carandraug
Recipients carandraug
Date 2018-11-28.14:50:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
set union, intersection, difference methods accept any non-zero number of sets and return a new set instance, like so:

    >>> a = set([1, 2])
    >>> b = set([1, 3])
    >>> c = set([3, 5])
    >>> set.union(a, b, c)
    {1, 2, 3, 5}

even if it's only one argument:

    >>> set.union(a)
    {1, 2}

I think it would be nice if zero arguments were not an error:

    >>> set.union()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: descriptor 'union' of 'set' object needs an argument

This would allow to handle any sequence of sets which otherwise requires this:

    if len(sequence):
        return set.union(*sequence)
        return set()
Date User Action Args
2018-11-28 14:50:56carandraugsetrecipients: + carandraug
2018-11-28 14:50:55carandraugsetmessageid: <>
2018-11-28 14:50:55carandrauglinkissue35338 messages
2018-11-28 14:50:55carandraugcreate