[Python-ideas] exclusively1, common, exclusively2 = set1 - set2, set1 & set2, set2 - set1
Shane Green
shane at umbrellacode.com
Sun Jul 7 00:47:22 CEST 2013
subsets?
On Jul 6, 2013, at 1:06 PM, Jan Kaliszewski <zuo at chopin.edu.pl> wrote:
> 06.07.2013 19:26, Steven D'Aprano wrote:
>
>> On 07/07/13 01:34, Stephen J. Turnbull wrote:
>>> Steven D'Aprano writes:
>>>
>>> > "partition" is not the ideal name for this method,
>>>
>>> +1
>>>
>>> It would completely confuse anybody who did want a partition.
>>>
>>> > but the actual operation itself is very useful. I have often done
>>> > this, mostly on dict views rather than sets. In my head, it's an
>>> > obvious operation, to split a pair of sets into three, spoiled only
>>> > by lack of a good name.
>>> >
>>> > Perhaps "split" is a reasonable name?
>>> >
>>> > only1, both, only2 = set1.split(set2)
>>>
>>> -1
>>>
>>> Set splitting is an intractable problem.
>>> https://en.wikipedia.org/wiki/Set_splitting_problem
> [...]
>>> I propose "join".[1]
>> ...
>>> [1] Or maybe it's the meet? I never can keep the two straight....
>>
>> I don't think that either is appropriate. Join and meet are
>> operations on a single set, not a pair of them
> [...]
>
> Other ideas for the method name:
>
> * trisect
> * trisection
> * cover
> * over
> * overlap
> * interfere
>
> Cheers.
> *j
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
More information about the Python-ideas
mailing list