#8456: lazy import improvements
---------------------------+------------------------------------------------
Reporter: robertwb | Owner: tbd
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-4.3.4
Component: misc | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
---------------------------+------------------------------------------------
Changes (by SimonKing):
* status: needs_review => needs_work
Comment:
I started with importing the first patch only. I tried to lazy-import ZZ,
but it did not properly work:
{{{
sage: from sage.misc.lazy_import import lazy_import
sage: lazy_import('sage.rings.all', 'ZZ')
sage: type(ZZ)
<type 'sage.rings.integer_ring.IntegerRing_class'>
}}}
According to the doc tests, the result should be different.
I then imported the second patch. When starting sage, I got
{{{
---------------------------------------------------------------------------
OSError Traceback (most recent call
last)
/home/king/SAGE/sage-4.3.1/local/lib/python2.6/site-
packages/IPython/ipmaker.pyc in force_import(modname)
64 reload(sys.modules[modname])
65 else:
---> 66 __import__(modname)
67
68
/home/king/SAGE/sage-4.3.1/local/bin/ipy_profile_sage.py in <module>()
5 preparser(True)
6
----> 7 import sage.all_cmdline
8 sage.all_cmdline._init_cmdline(globals())
9
/home/king/SAGE/sage-4.3.1/local/lib/python2.6/site-
packages/sage/all_cmdline.py in <module>()
12 try:
13
---> 14 from sage.all import *
15 from sage.calculus.predefined import x
16 preparser(on=True)
/home/king/SAGE/sage-4.3.1/local/lib/python2.6/site-packages/sage/all.py
in <module>()
323 # Cache the contents of star imports.
324 import sage.misc.lazy_import
--> 325 sage.misc.lazy_import.save_cache_file()
326
327
/home/king/SAGE/sage-4.3.1/local/lib/python2.6/site-
packages/sage/misc/lazy_import.so in sage.misc.lazy_import.save_cache_file
(sage/misc/lazy_import.c:1977)()
OSError: [Errno 18] Invalid cross-device link
Error importing ipy_profile_sage - perhaps you should run %upgrade?
WARNING: Loading of ipy_profile_sage failed.
}}}
No idea what this means. But I think it is "needs work".
Cheers, Simon
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8456#comment:2>
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.