#14767: Fix import_statements for lazy imported objects
-------------------------------------+--------------------------------------
Reporter: tmonteil | Owner: jason
Type: defect | Status: positive_review
Priority: major | Milestone: sage-5.11
Component: misc | Resolution:
Keywords: days49 | Work issues:
Report Upstream: N/A | Reviewers: Nicolas M. ThiƩry
Authors: Vincent Delecroix | Merged in:
Dependencies: | Stopgaps:
-------------------------------------+--------------------------------------
Comment (by tmonteil):
The patch works for me as well, and fixes the bug i mentionned.
However, i think both points of view are valid:
- it is useless to add a layer when one imports a module for a direct use.
- on the other hand, developpers using this to modify Sage's source code
should know that the module is currently only lazy imported. Indeed, if
they "hard" import the module, this will lose the benefits of related
lazy imports in terms of startup time.
As a limited developper, if i didn't fall on the bug when writing #10358,
i would have written
`from sage.rings.semirings.non_negative_integer_semiring import NN`
instead of
`lazy_import('sage.rings.semirings.non_negative_integer_semiring','NN')`.
Hence, what i may suggest it to keep Vincent's behaviour as first output,
and
when the module is only lazy imported in the Sage code, then add a warning
explaining this, and output the lazy statement as well.
Does this make sense ?
Thierry (late as usually, or perhaps is the workflow too fast for me ;)
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14767#comment:13>
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/groups/opt_out.