def test_Number_new():
 assert (Number(1) is S.One)
 assert (Number(2).__class__ is Integer)
 assert (Number((-622)).__class__ is Integer)
 assert (Number(5, 3).__class__ is Rational)
 assert (Number(5.3).__class__ is Float)
 assert (Number('1') is S.One)
 assert (Number('2').__class__ is Integer)
 assert (Number('-622').__class__ is Integer)
 assert (Number('5/3').__class__ is Rational)
 assert (Number('5.3').__class__ is Float)
 raises(ValueError, (lambda : Number('cos')))
 raises(TypeError, (lambda : Number(cos)))
 a = Rational(3, 5)
 assert (Number(a) is a)

def test_Number_new ( ) : assert ( Number ( 1 ) is S . One ) assert ( Number ( 2 ) . __class__ is Integer ) assert ( Number ( ( - 622 ) ) . __class__ is Integer ) assert ( Number ( 5 , 3 ) . __class__ is Rational ) assert ( Number ( 5.3 ) . __class__ is Float ) assert ( Number ( '1' ) is S . One ) assert ( Number ( '2' ) . __class__ is Integer ) assert ( Number ( '-622' ) . __class__ is Integer ) assert ( Number ( '5/3' ) . __class__ is Rational ) assert ( Number ( '5.3' ) . __class__ is Float ) raises ( ValueError , ( lambda : Number ( 'cos' ) ) ) raises ( TypeError , ( lambda : Number ( cos ) ) ) a = Rational ( 3 , 5 ) assert ( Number ( a ) is a )
test for number constructor .