File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,23 @@ that (s)he can remove the flag::
36
36
UserWarning: Option ``at_startup=True`` for lazy import ZZ not needed anymore
37
37
Integer Ring
38
38
39
+ .. WARNING::
40
+
41
+ After the first usage, the imported object is directly injected into the
42
+ namespace; however, before that, the :class:`LazyImport` object
43
+ is not exactly equivalent to the actual imported object. For example::
44
+
45
+ sage: from sage. misc. lazy_import import LazyImport
46
+ sage: my_qqbar = LazyImport( 'sage. rings. qqbar', 'QQbar')
47
+ sage: my_qqbar( 5) == QQbar( 5) # good
48
+ True
49
+ sage: isinstance( QQbar, Parent)
50
+ True
51
+ sage: isinstance( my_qqbar, Parent) # fails!
52
+ False
53
+
54
+ To avoid this issue, you may execute the import inside the function instead.
55
+
39
56
.. SEEALSO:: :func:`lazy_import`, :class:`LazyImport`
40
57
41
58
AUTHOR:
Original file line number Diff line number Diff line change 159
159
160
160
lazy_import ('sage.interfaces.singular' , 'singular' )
161
161
lazy_import ('sage.rings.number_field.number_field' , 'NumberField' )
162
- lazy_import ('sage.rings.qqbar' , ['number_field_elements_from_algebraics' , 'QQbar' ])
163
162
164
163
from .curve import Curve_generic
165
164
@@ -1452,6 +1451,7 @@ def ordinary_model(self):
1452
1451
"""
1453
1452
# helper function for extending the base field
1454
1453
1454
+ from sage .rings .qqbar import number_field_elements_from_algebraics , QQbar
1455
1455
def extension (self ):
1456
1456
F = self .base_ring ()
1457
1457
pts = self .change_ring (F .embeddings (QQbar )[0 ]).rational_points ()
You can’t perform that action at this time.
0 commit comments