def test_key_extensibility():
 raises(AttributeError, (lambda : ask(Q.my_key(x))))
 class MyAskHandler(AskHandler, ):
  @staticmethod
  def Symbol(expr, assumptions):
   return True
 register_handler('my_key', MyAskHandler)
 assert (ask(Q.my_key(x)) is True)
 assert (ask(Q.my_key((x + 1))) is None)
 remove_handler('my_key', MyAskHandler)
 del Q.my_key
 raises(AttributeError, (lambda : ask(Q.my_key(x))))

def test_key_extensibility ( ) : raises ( AttributeError , ( lambda : ask ( Q . my_key ( x ) ) ) ) class MyAskHandler ( AskHandler , ) : @ staticmethod def Symbol ( expr , assumptions ) : return True register_handler ( 'my_key' , MyAskHandler ) assert ( ask ( Q . my_key ( x ) ) is True ) assert ( ask ( Q . my_key ( ( x + 1 ) ) ) is None ) remove_handler ( 'my_key' , MyAskHandler ) del Q . my_key raises ( AttributeError , ( lambda : ask ( Q . my_key ( x ) ) ) )
test that you can add keys to the ask system at runtime .