Repository: sympy/sympy
Pull request: Moved arithematic operators to sympy/sets/sets.py
All the functions related to generic use for all sets are moved from
sympy/sets/setexpr.py to sympy/sets/sets.py

<!-- Your title above should be a short description of what
was changed. Do not include the issue number in the title. -->

#### References to other Issues or PRs
<!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact
format, e.g. "Fixes #1234". See
https://github.com/blog/1506-closing-issues-via-pull-requests .-->
Fixes #14366 



Problem statement:
Move set arithmetic operators to sympy/sets/sets.py
Set arithmetic operators such as `set_add` and the function application on sets (`set_function`) have been defined in `sympy/sets/setexpr.py` to support `SetExpr`.

They are actually of generic use for all sets, so they should rather stay in `sympy/sets/sets.py`.

Hints from issue discussion:
Let's do it before version 1.2, so no API break.
Do we have to move all the set arithmetic operators?
I am beginner, can I work on this?
I am going to make a pull request for this issue. Please give your review on that.

Beginner here. Can I look into this issue?

Commit message: Moved arithematic operators to sympy/sets/sets.py

All the functions related to generic use for all sets are moved from
sympy/sets/setexpr.py to sympy/sets/sets.py

Patch to review:
diff --git a/sympy/sets/setexpr.py b/sympy/sets/setexpr.py
index 5ea277ec3559..fb605a8b54c3 100644
--- a/sympy/sets/setexpr.py
+++ b/sympy/sets/setexpr.py
@@ -5,7 +5,7 @@
 from sympy.core.decorators import call_highest_priority, _sympifyit
 from sympy.utilities.iterables import sift
 from sympy.multipledispatch import dispatch, Dispatcher
-
+from sympy.sets.sets import set_add, set_sub, set_mul, set_div, set_pow, set_function
 
 d = Dummy('d')
 
@@ -130,27 +130,3 @@ def _apply_operation(op, x, y, commutative):
         else:
             out = ImageSet(Lambda((_x, _y), op(_x, _y)), x, y)
     return out
-
-def set_add(x, y):
-    from sympy.sets.handlers.add import _set_add
-    return _apply_operation(_set_add, x, y, commutative=True)
-
-def set_sub(x, y):
-    from sympy.sets.handlers.add import _set_sub
-    return _apply_operation(_set_sub, x, y, commutative=False)
-
-def set_mul(x, y):
-    from sympy.sets.handlers.mul import _set_mul
-    return _apply_operation(_set_mul, x, y, commutative=True)
-
-def set_div(x, y):
-    from sympy.sets.handlers.mul import _set_div
-    return _apply_operation(_set_div, x, y, commutative=False)
-
-def set_pow(x, y):
-    from sympy.sets.handlers.power import _set_pow
-    return _apply_operation(_set_pow, x, y, commutative=False)
-
-def set_function(f, x):
-    from sympy.sets.handlers.functions import _set_function
-    return _set_function(f, x)
diff --git a/sympy/sets/sets.py b/sympy/sets/sets.py
index 80c1122346e3..c67ae1dc4cd4 100644
--- a/sympy/sets/sets.py
+++ b/sympy/sets/sets.py
@@ -20,13 +20,11 @@
 from sympy.sets.contains import Contains
 from sympy.utilities.iterables import sift
 from sympy.utilities.misc import func_name, filldedent
-
 from mpmath import mpi, mpf
 from sympy.logic.boolalg import And, Or, Not, true, false
 from sympy.utilities import subsets
 from sympy.multipledispatch import dispatch
 
-
 class Set(Basic):
     """
     The base class for any kind of set.
@@ -1959,3 +1957,33 @@ def simplify_intersection(args):
         return args.pop()
     else:
         return Intersection(args, evaluate=False)
+
+def set_add(x, y):
+    from sympy.sets.handlers.add import _set_add
+    from sympy.sets.setexpr import _apply_operation
+    return _apply_operation(_set_add, x, y, commutative=True)
+
+def set_sub(x, y):
+    from sympy.sets.handlers.add import _set_sub
+    from sympy.sets.setexpr import _apply_operation
+    return _apply_operation(_set_sub, x, y, commutative=False)
+
+def set_mul(x, y):
+    from sympy.sets.handlers.mul import _set_mul
+    from sympy.sets.setexpr import _apply_operation
+    return _apply_operation(_set_mul, x, y, commutative=True)
+
+def set_div(x, y):
+    from sympy.sets.handlers.mul import _set_div
+    from sympy.sets.setexpr import _apply_operation
+    return _apply_operation(_set_div, x, y, commutative=False)
+
+def set_pow(x, y):
+    from sympy.sets.handlers.power import _set_pow
+    from sympy.sets.setexpr import _apply_operation
+    return _apply_operation(_set_pow, x, y, commutative=False)
+
+def set_function(f, x):
+    from sympy.sets.handlers.functions import _set_function
+    from sympy.sets.setexpr import _apply_operation
+    return _set_function(f, x)


Code review comments:
diff_hunk: @@ -1959,3 +1957,33 @@ def simplify_intersection(args):
         return args.pop()
     else:
         return Intersection(args, evaluate=False)
+
+def set_add(x, y):
+    from sympy.sets.handlers.add import _set_add
+    from sympy.sets.setexpr import _apply_operation
+    return _apply_operation(_set_add, x, y, commutative=True)
+
+def set_sub(x, y):
+    from sympy.sets.handlers.add import _set_sub
+    from sympy.sets.setexpr import _apply_operation
+    return _apply_operation(_set_sub, x, y, commutative=False)
+
+def set_mul(x, y):
+    from sympy.sets.handlers.mul import _set_mul
+    from sympy.sets.setexpr import _apply_operation
+    return _apply_operation(_set_mul, x, y, commutative=True)
+
+def set_div(x, y):
+    from sympy.sets.handlers.mul import _set_div
+    from sympy.sets.setexpr import _apply_operation
+    return _apply_operation(_set_div, x, y, commutative=False)
+
+def set_pow(x, y):
+    from sympy.sets.handlers.power import _set_pow
+    from sympy.sets.setexpr import _apply_operation
+    return _apply_operation(_set_pow, x, y, commutative=False)
+
+def set_function(f, x):
+    from sympy.sets.handlers.functions import _set_function
+    from sympy.sets.setexpr import _apply_operation
path: sympy/sets/sets.py
text: @user1:

```_apply_operation``` function is not needed here so no need to import it here.

@author:
> _apply_operation function is not needed here so no need to import it here.

removed it. 
Is it fine now?