Why not use "&" and "|" ?

sage: A = Set([1,2,3,4,5])
sage: B = Set([3,4,5,6,7])
sage: A & B
{3, 4, 5}
sage: A | B
{1, 2, 3, 4, 5, 6, 7}


On Tuesday, March 29, 2022 at 11:34:14 AM UTC+2 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/27417eb0-818e-4116-a1d7-9e380153095dn%40googlegroups.com.

Reply via email to