#14187: Check that lazy imports are not resolved during startup
--------------------------------+-------------------------------------------
Reporter: vbraun | Owner: tbd
Type: enhancement | Status: new
Priority: major | Milestone: sage-5.8
Component: performance | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Volker Braun | Merged in:
Dependencies: | Stopgaps:
--------------------------------+-------------------------------------------
Comment (by nthiery):
Ok, I investigated that, and the issue is as follow:
- On Sage's startup, one create NN which is a facade set (in
Sets().Facade())
- Sets lazily imports FacadeSets to avoid an import loop: FacadeSets uses
Sets,
but we want a reference Sets.Facades -> FacadeSets
Note that with the upcoming functorial construction that will be a
very common idiom even for low level categories like
Magma().Commutative() that we certainly will load on startup.
So the problem we are having is that LazyImport serves to purposes:
- avoiding to load stuff on Sage's startup
- break import loops.
Granted, it's not soo nice to setup a safety guard and immediately
provide a way to work around it ... but what about adding an explicit
option so that one could explicitly disable the warning when we know
that the lazy import is really just about breaking an import loop?
LazyImport('sage.categories.facade_sets', 'FacadeSets',
dont_warn_on_startup=True)
or
LazyImport('sage.categories.facade_sets', 'FacadeSets',
can_be_evaluated_on_startup=True)
Cheers,
Nicolas
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14187#comment:6>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.