Sorry, I did not find anything about this in the docs for Sets (but I
should have tried the operators for Python sets).

Guillermo

On Tue, 29 Mar 2022 at 20:25, Matthias Koeppe <matthiaskoe...@gmail.com>
wrote:

> -1 on this; as Sébastien says, we already have overloaded the bitwise
> operators &, | for this -- which is consistent with Python's operators for
> set and frozenset - https://docs.python.org/3/library/stdtypes.html#set
> (Note Python's set and frozenset do not support +.)
>
> On Tuesday, March 29, 2022 at 2:34:14 AM UTC-7 GMS wrote:
>
>>
>> I have noticed the overloading of + for Set union, which I find very
>> convenient.
>>
>> Correspondingly, I would like to propose the overloading of * for Set
>> intersection.
>>
>> It seems to me that it suffices to modify
>> local/lib/python3.9/site-packages/sage/sets/set.py
>> by adding in
>> class Set_add_sub_operators:
>> the lines
>>     def _mul_(self, X):
>>         """
>>         Return the intersection of ``self`` and ``X``.
>>         """
>>         return self.intersection(X)
>>
>> I have tested this and it works as expected.
>>
>> Should I open a ticket?  I shall have to learn how to deal with commits.
>>
>> I am aware of the overloading of * in real_set.py, but I think they are
>> compatible.
>>
>> Thanks,
>>
>> Guillermo
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CANnG188HOjcZGoNGwThmCOySamJ9yTbKtg7meB5oR1%2B5Jmg8xQ%40mail.gmail.com.

Reply via email to