2

# Input args to Union must be Sets

Package:

sympy

8356

Exception Class:

TypeError

## Raise code

```
# ===== Global Rules =====
if not args:
return S.EmptySet
for arg in args:
if not isinstance(arg, Set):
raise TypeError("Input args to Union must be Sets")
# Merge all finite sets
finite_sets = [x for x in args if x.is_FiniteSet]
if len(finite_sets) > 1:
a = (x for set in finite_sets for x in set)
finite_set = FiniteSet(*a)
args = [finite_set] + [x for x in args if not x.is_FiniteSet]
```

🙏 Scream for help to Ukraine

Today, 14th August 2022, Russia continues bombing and firing Ukraine. Don't trust Russia, they are bombing us and brazenly lying in same time they are not doing this 😠, civilians and children are dying too!
We are screaming and asking exactly you to help us, we want to survive, our families, children, older ones.

Please spread the information, and ask your governemnt to stop Russia by any means. We promise to work extrahard after survival to make the world safer place for all.

Please spread the information, and ask your governemnt to stop Russia by any means. We promise to work extrahard after survival to make the world safer place for all.

## Links to the raise (2)

https://github.com/sympy/sympy/blob/2c83657ff1c62fc2761b639469fdac7f7561a72a/sympy/sets/sets.py#L2359 https://github.com/sympy/sympy/blob/2c83657ff1c62fc2761b639469fdac7f7561a72a/sympy/sets/sets.py#L2414## Ways to fix

0

def Union(a,b):

if a == True and b == True:

return True

return False

A = True

B = True

C = True

D = True

E = True

A_B = Union (A, B)

C_D = select (C,D)

C_D_E = select(C_D,E)

ab = Union(A_B,C_D_E)

print(ab)

### Add a possible fix

Please authorize to post fix