File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -3,9 +3,9 @@ from sage.structure.sage_object cimport SageObject
3
3
cdef class Function(SageObject):
4
4
cdef unsigned int _serial
5
5
cdef int _nargs
6
- cdef object _name
7
- cdef object _alt_name
8
- cdef object _latex_name
6
+ cdef str _name
7
+ cdef str _alt_name
8
+ cdef str _latex_name
9
9
cdef object _conversions
10
10
cdef object _evalf_params_first
11
11
cdef _is_registered(self )
@@ -16,7 +16,7 @@ cdef class BuiltinFunction(Function):
16
16
cdef _is_registered(self )
17
17
18
18
cdef class GinacFunction(BuiltinFunction):
19
- cdef object _ginac_name
19
+ cdef str _ginac_name
20
20
cdef _is_registered(self )
21
21
cdef _register_function(self )
22
22
Original file line number Diff line number Diff line change 157
157
except ImportError :
158
158
register_or_update_function = None
159
159
160
+ cdef object SR = None , PolynomialRing_commutative = None , MPolynomialRing_polydict_domain = None
160
161
161
162
# List of functions which ginac allows us to define custom behavior for.
162
163
# Changing the order of this list could cause problems unpickling old pickles.
@@ -1057,11 +1058,15 @@ cdef class BuiltinFunction(Function):
1057
1058
if (self ._preserved_arg
1058
1059
and isinstance (args[self ._preserved_arg- 1 ], Element)):
1059
1060
arg_parent = parent(args[self ._preserved_arg- 1 ])
1060
- from sage.symbolic.ring import SR
1061
+ global SR
1062
+ if SR is None :
1063
+ from sage.symbolic.ring import SR
1061
1064
if arg_parent is SR:
1062
1065
return res
1063
- from sage.rings.polynomial.polynomial_ring import PolynomialRing_commutative
1064
- from sage.rings.polynomial.multi_polynomial_ring import MPolynomialRing_polydict_domain
1066
+ global PolynomialRing_commutative, MPolynomialRing_polydict_domain
1067
+ if PolynomialRing_commutative is None :
1068
+ from sage.rings.polynomial.polynomial_ring import PolynomialRing_commutative
1069
+ from sage.rings.polynomial.multi_polynomial_ring import MPolynomialRing_polydict_domain
1065
1070
if isinstance (arg_parent, (PolynomialRing_commutative,
1066
1071
MPolynomialRing_polydict_domain)):
1067
1072
try :
You can’t perform that action at this time.
0 commit comments