def test_math_subclass():
 import math
 class myfloat(float, ):
  pass
 class mylong(long, ):
  pass
 mf = myfloat(1)
 ml = mylong(1)
 for x in (math.log, math.log10, math.log1p, math.asinh, math.acosh, math.atanh, math.factorial, math.trunc, math.isinf):
  try:
   resf = x(mf)
  except ValueError:
   resf = None
  try:
   resl = x(ml)
  except ValueError:
   resl = None
  AreEqual(resf, resl)

def test_math_subclass ( ) : import math class myfloat ( float , ) : pass class mylong ( long , ) : pass mf = myfloat ( 1 ) ml = mylong ( 1 ) for x in ( math . log , math . log10 , math . log1p , math . asinh , math . acosh , math . atanh , math . factorial , math . trunc , math . isinf ) : try : resf = x ( mf ) except ValueError : resf = None try : resl = x ( ml ) except ValueError : resl = None AreEqual ( resf , resl )
verify subtypes of float/long work w/ math functions .