def test_hexoct():
 class foo(object, ):
  def __hex__(self):
   return self
  def __oct__(self):
   return self
 class bar:
  def __hex__(self):
   return self
  def __oct__(self):
   return self
 AssertError(TypeError, hex, foo())
 AssertError(TypeError, oct, foo())
 AssertError(TypeError, hex, bar())
 AssertError(TypeError, oct, bar())

def test_hexoct ( ) : class foo ( object , ) : def __hex__ ( self ) : return self def __oct__ ( self ) : return self class bar : def __hex__ ( self ) : return self def __oct__ ( self ) : return self AssertError ( TypeError , hex , foo ( ) ) AssertError ( TypeError , oct , foo ( ) ) AssertError ( TypeError , hex , bar ( ) ) AssertError ( TypeError , oct , bar ( ) )
returning non-string from hex & oct should throw .