#11003: Improve support for lazy_import inside classes
---------------------------+------------------------------------------------
   Reporter:  nthiery      |       Owner:  jason        
       Type:  enhancement  |      Status:  new          
   Priority:  major        |   Milestone:  sage-wishlist
  Component:  misc         |    Keywords:               
     Author:               |    Upstream:  N/A          
   Reviewer:               |      Merged:               
Work_issues:               |  
---------------------------+------------------------------------------------
 Currently, one can do:

 {{{
     sage: class foo(object):
     ...       bar = LazyImport('sage.bar', 'bar')
     sage: foo.bar
     bar
 }}}

 and this works (assuming sage.bar.bar exists of course). As a
 syntactic sugar, it would be nice to have lazy_import work as well, if
 possible with the automatic back-insertion of the object into the
 class after the actual import occurred:

 {{{
     sage: class foo(object):
     ...       lazy_import('sage.bar', 'bar')
     sage: type(foo.bar)
     <type 'sage.misc.lazy_import.LazyImport'>
     sage: foo.bar
     bar
     sage: type(foo.bar)
     <type 'bar_type>
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11003>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to