Repository: sympy/sympy

Issue:
Use Dummy symbols in ComplexPlane
We implemented `ComplexPlane` here #9463,  Currently we defined symbols internally as:
```
x, y, r, theta = symbols('x, y, r, theta')
```
The above symbols should be changed to Dummy symbols.

Discussion:

Patch:
diff --git a/sympy/sets/fancysets.py b/sympy/sets/fancysets.py
index c44d8d3b8a..0a597f4edf 100644
--- a/sympy/sets/fancysets.py
+++ b/sympy/sets/fancysets.py
@@ -573,7 +573,7 @@ class ComplexPlane(Set):
     >>> c = Interval(1, 8)
     >>> c1 = ComplexPlane(a*b)  # Rectangular Form
     >>> c1
-    ComplexPlane(Lambda((x, y), x + I*y), [2, 3] x [4, 6])
+    ComplexPlane(Lambda((_x, _y), _x + _y*I), [2, 3] x [4, 6])
 
     * c1 represents the rectangular region in complex plane
       surrounded by the coordinates (2, 4), (3, 4), (3, 6) and
@@ -581,7 +581,7 @@ class ComplexPlane(Set):
 
     >>> c2 = ComplexPlane(Union(a*b, b*c))
     >>> c2
-    ComplexPlane(Lambda((x, y), x + I*y),
+    ComplexPlane(Lambda((_x, _y), _x + _y*I),
                  [2, 3] x [4, 6] U [4, 6] x [1, 8])
 
     * c2 represents the Union of two rectangular regions in complex
@@ -598,7 +598,7 @@ class ComplexPlane(Set):
     >>> theta = Interval(0, 2*S.Pi)
     >>> c2 = ComplexPlane(r*theta, polar=True)  # Polar Form
     >>> c2  # unit Disk
-    ComplexPlane(Lambda((r, theta), r*(I*sin(theta) + cos(theta))),
+    ComplexPlane(Lambda((_r, _theta), _r*(I*sin(_theta) + cos(_theta))),
                  [0, 1] x [0, 2*pi))
 
     * c2 represents the region in complex plane inside the
@@ -613,7 +613,7 @@ class ComplexPlane(Set):
     >>> upper_half_unit_disk = ComplexPlane(Interval(0, 1)*Interval(0, S.Pi), polar=True)
     >>> intersection = unit_disk.intersect(upper_half_unit_disk)
     >>> intersection
-    ComplexPlane(Lambda((r, theta), r*(I*sin(theta) + cos(theta))), [0, 1] x [0, pi])
+    ComplexPlane(Lambda((_r, _theta), _r*(I*sin(_theta) + cos(_theta))), [0, 1] x [0, pi])
     >>> intersection == upper_half_unit_disk
     True
 
@@ -626,9 +626,9 @@ class ComplexPlane(Set):
     is_ComplexPlane = True
 
     def __new__(cls, sets, polar=False):
-        from sympy import symbols
+        from sympy import symbols, Dummy
 
-        x, y, r, theta = symbols('x, y, r, theta')
+        x, y, r, theta = symbols('x, y, r, theta', cls=Dummy)
         I = S.ImaginaryUnit
 
         # Rectangular Form


Test patch:
diff --git a/sympy/printing/pretty/tests/test_pretty.py b/sympy/printing/pretty/tests/test_pretty.py
index 9cba38a101..d32806b57f 100644
--- a/sympy/printing/pretty/tests/test_pretty.py
+++ b/sympy/printing/pretty/tests/test_pretty.py
@@ -3110,7 +3110,7 @@ def test_pretty_ConditionSet():
 
 def test_pretty_ComplexPlane():
     from sympy import ComplexPlane
-    ucode_str = u('{x + ⅈ⋅y | x, y ∊ [3, 5] × [4, 6]}')
+    ucode_str = u('{x + y⋅ⅈ | x, y ∊ [3, 5] × [4, 6]}')
     assert upretty(ComplexPlane(Interval(3, 5)*Interval(4, 6))) == ucode_str
 
     ucode_str = u('{r⋅(ⅈ⋅sin(θ) + cos(θ)) | r, θ ∊ [0, 1] × [0, 2⋅π)}')
diff --git a/sympy/printing/tests/test_latex.py b/sympy/printing/tests/test_latex.py
index a24fc533d2..56db3af167 100644
--- a/sympy/printing/tests/test_latex.py
+++ b/sympy/printing/tests/test_latex.py
@@ -618,7 +618,7 @@ def test_latex_ConditionSet():
 
 def test_latex_ComplexPlane():
     assert latex(ComplexPlane(Interval(3, 5)*Interval(4, 6))) == \
-        r"\left\{x + i y\; |\; x, y \in \left[3, 5\right] \times \left[4, 6\right] \right\}"
+        r"\left\{x + y i\; |\; x, y \in \left[3, 5\right] \times \left[4, 6\right] \right\}"
     assert latex(ComplexPlane(Interval(0, 1)*Interval(0, 2*pi), polar=True)) == \
         r"\left\{r \left(i \sin{\left (\theta \right )} + \cos{\left (\theta \right )}\right)\; |\; r, \theta \in \left[0, 1\right] \times \left[0, 2 \pi\right) \right\}"