#19628: lazy_import breaks CachedRepresentation
----------------------------+-------------------------
       Reporter:  cheuberg  |        Owner:
           Type:  defect    |       Status:  new
       Priority:  major     |    Milestone:  sage-6.10
      Component:  coercion  |   Resolution:
       Keywords:            |    Merged in:
        Authors:            |    Reviewers:
Report Upstream:  N/A       |  Work issues:
         Branch:            |       Commit:
   Dependencies:            |     Stopgaps:
----------------------------+-------------------------

Comment (by nbruin):

 Replying to [comment:13 jdemeyer]:

 > Of course, now the question becomes: which scopes? If you can hand me a
 list of `dict`s which contain all relevant lazy imports, we can indeed do
 something.

 All scopes that `from ... import` a symbol that is a `LazyImport`. That
 includes many "all" files. Each of those should basically finish with a
 {{{
 sage.misc.lazy_import.fix_sloppily_constructed_namespace(globals())
 }}}
 (and then we should hope that no fancy shenanigans have happened with the
 bindings during module initialization)

 We should consider how badly this affects startup times. In time-critical
 bits, it may be better to use a fresh `lazy_import` command instead
 instead of fixing the namespace afterwards.

 One could run this process on `[m for m in sys.modules().itervalues() if m
 is not None]` (there are quite some entries in there that are None. I
 don't know what they're doing there. Vanilla python has that too), but
 we'd really be meddling with data that isn't ours, so I'd expect that to
 lead to more fragileness.

 The namespaces registered under `sys.modules()` would certainly provide a
 good starting point for assessing the scale of the problem.

--
Ticket URL: <http://trac.sagemath.org/ticket/19628#comment:19>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to