#NEWLINE# def test_real( ) : #NEWLINE# #INDENT# x = Symbol ( 'x' , real = True , finite = True ) #NEWLINE# I = Interval ( 0 , 5 ) #NEWLINE# J = Interval ( 10 , 20 ) #NEWLINE# A = FiniteSet ( 1 , 2 , 30 , x , S . Pi ) #NEWLINE# B = FiniteSet ( ( - 4 ) , 0 ) #NEWLINE# C = FiniteSet ( 100 ) #NEWLINE# D = FiniteSet ( 'Ham' , 'Eggs' ) #NEWLINE# assert all ( ( s . is_subset ( S . Reals ) for s in [ I , a , A , B , C ] ) ) #NEWLINE# assert ( not D . is_subset ( S . Reals ) ) #NEWLINE# assert all ( ( ( a + b ) . is_subset ( S . Reals ) for a in [ I , J , A , B , C ] for b in [ I , J , A , B , C ] ) ) #NEWLINE# assert ( not any ( ( ( a + D ) . is_subset ( S . Reals ) for a in [ I , J , A , B , C , D ] ) ) ) #NEWLINE# assert ( not ( ( I + A ) + D ) . is_subset ( S . Reals ) )