[Python-ideas] exclusively1, common, exclusively2 = set1 - set2, set1 & set2, set2 - set1

Jan Kaliszewski zuo at chopin.edu.pl
Sat Jul 6 22:06:09 CEST 2013


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


More information about the Python-ideas mailing list

AltStyle によって変換されたページ (->オリジナル) /