# HG changeset patch
# User Nils Bruin <nbruin@sfu.ca>
# Date 1298778069 28800
# Node ID b41f2d4bc008dccc4a444188d6630090e9e1b4db
# Parent 5a8bc0eaef71c044f6c0e0518566fee3c7a7ee1e
Make calculus load its maxima instance in a lazy way
diff r 5a8bc0eaef71 r b41f2d4bc008 sage/calculus/calculus.py
a

b


383  383  sage: sage.calculus.calculus.maxima('f1') 
384  384  f1 
385  385  """ 
386   import sage.interfaces.maxima_lib 
387   maxima = sage.interfaces.maxima_lib.maxima_lib 
 386  class lazy(object): 
 387  def __init__(self): 
 388  pass 
 389  
 390  def __getattr__(self,key): 
 391  import sage.interfaces.maxima_lib 
 392  sage.calculus.calculus.maxima = sage.interfaces.maxima_lib.maxima 
 393  return getattr(sage.interfaces.maxima_lib.maxima,key) 
 394  
 395  def __hasattr__(self, key): 
 396  import sagge.interfaces.maxima_lib 
 397  sage.calculus.calculus.maxima = sage.interfaces.maxima_lib.maxima 
 398  return hasattr(sage.interfaces.maxima_lib.maxima,key) 
 399  
 400  def __setattr__(self, key, value): 
 401  import sage.interfaces.maxima_lib 
 402  sage.calculus.calculus.maxima = sage.interfaces.maxima_lib.maxima 
 403  return setattr(sage.interfaces.maxima_lib.maxima, key, value) 
 404  
 405  maxima = lazy() 
388  406  # This is not the same instance of Maxima as the general purpose one 
389  407  #from sage.interfaces.maxima import Maxima 
390  408  #maxima = Maxima(init_code = ['display2d : false', 'domain : complex', 