#10906: lazy import can break unique representation
-----------------------+----------------------------------------------------
   Reporter:  nthiery  |       Owner:  jason                             
       Type:  defect   |      Status:  new                               
   Priority:  major    |   Milestone:                                    
  Component:  misc     |    Keywords:  lazy import, unique representation
     Author:           |    Upstream:  N/A                               
   Reviewer:           |      Merged:                                    
Work_issues:           |  
-----------------------+----------------------------------------------------

Comment(by robertwb):

 Lazy import are mostly used to avoid importing expensive modules when you
 might want to use their functionality. It would be both inefficient and
 messy to use at a fine-graned level. Whole modules are nice to lazily
 import, e.g.

 {{{
 sage: lazy_import('sage.rings', 'all', 'rings')
 sage: rings
 <module 'sage.rings.all' from
 '/mnt/usb1/scratch/robertwb/sage-4.6.2.rc1/local/lib/python2.6/site-
 packages/sage/rings/all.pyc'>
 }}}

 then you can use rings.X and it will resolve lazily. This can be
 especially useful for heavy, external dependencies (e.g. matplotlib).

 As for the basic objects like ZZ, QQ, CC, etc. there's no reason to lazily
 import them, as those modules will always be already loaded. The safest
 are modules and callables, using lazy_import objects is just fine, passing
 them around is more dangerous.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10906#comment:3>
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