I made http://trac.sagemath.org/ticket/17996 for the missing A.n?? source.


On Wednesday, March 18, 2015 at 10:16:29 PM UTC+1, John Cremona wrote:
>
> OK, so it is not the same as the other Pari recursion bug which was 
> fixed.  I saw the ticket.  I have never used the .n() method on 
> anything, and when I want to embed a number field K into RR or CC I 
> use K.embeddings().  Otherwise I might have noticed this before. 
>
> I note that A.?? does *not* show the source code, which is not in the 
> file shown as the source of the A.n() function. 
>
> On 18 March 2015 at 15:34, kcrisman <[email protected] <javascript:>> 
> wrote: 
> >> Still happens with beta5. Do you want to open a ticket? 
> >> 
> > 
> > Confirmed and see http://trac.sagemath.org/ticket/17985 
> > 
> > 
> >> 
> >> ┌────────────────────────────────────────────────────────────────────┐ 
> >> │ Sage Version 6.6.beta5, Release Date: 2015-03-13                   │ 
> >> │ Type "notebook()" for the browser-based notebook interface.        │ 
> >> │ Type "help()" for help.                                            │ 
> >> └────────────────────────────────────────────────────────────────────┘ 
> >> ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ 
> >> ┃ Warning: this is a prerelease version, and it may be unstable.     ┃ 
> >> ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ 
> >> sage: GaussianIntegers = NumberField(x^2+1, 'I').ring_of_integers() 
> >> sage: A = GaussianIntegers([2,1]) 
> >> sage: A.n() 
> >> 
> >> 
> --------------------------------------------------------------------------- 
> >> RuntimeError                              Traceback (most recent call 
> >> last) 
> >> <ipython-input-3-f924bd0d29c9> in <module>() 
> >> ----> 1 A.n() 
> >> 
> >> /mnt/disk/home/release/Sage/src/sage/structure/element.pyx in 
> >> sage.structure.element.Element.numerical_approx 
> >> (build/cythonized/sage/structure/element.c:7435)() 
> >>     743         """ 
> >>     744         from sage.misc.functional import numerical_approx 
> >> --> 745         return numerical_approx(self, prec=prec, digits=digits, 
> >>     746                                 algorithm=algorithm) 
> >>     747     n = numerical_approx 
> >> 
> >> 
> >> 
> /mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/misc/functional.pyc
>  
>
> >> in numerical_approx(x, prec, digits, algorithm) 
> >>    1333     # The issue is not precision, try conversion instead 
> >>    1334     try: 
> >> -> 1335         return RR(x) 
> >>    1336     except (TypeError, ValueError): 
> >>    1337         pass 
> >> 
> >> /mnt/disk/home/release/Sage/src/sage/structure/parent.pyx in 
> >> sage.structure.parent.Parent.__call__ 
> >> (build/cythonized/sage/structure/parent.c:9602)() 
> >>    1092         if mor is not None: 
> >>    1093             if no_extra_args: 
> >> -> 1094                 return mor._call_(x) 
> >>    1095             else: 
> >>    1096                 return mor._call_with_args(x, args, kwds) 
> >> 
> >> /mnt/disk/home/release/Sage/src/sage/structure/coerce_maps.pyx in 
> >> sage.structure.coerce_maps.NamedConvertMap._call_ 
> >> (build/cythonized/sage/structure/coerce_maps.c:5819)() 
> >>     236             raise TypeError("Cannot coerce {} to {}".format(x, 
> C)) 
> >>     237         cdef Map m 
> >> --> 238         cdef Element e = method(C) 
> >>     239         if e is None: 
> >>     240             raise RuntimeError("BUG in coercion model: {} 
> method 
> >> of {} returned None".format(self.method_name, type(x))) 
> >> 
> >> 
> >> 
> /mnt/disk/home/release/Sage/src/sage/rings/number_field/number_field_element.pyx
>  
>
> >> in 
> sage.rings.number_field.number_field_element.NumberFieldElement._mpfr_ 
> >> 
> (build/cythonized/sage/rings/number_field/number_field_element.cpp:15017)() 
> >>    1383             return R(self.base_ring()(self)) 
> >>    1384         else: 
> >> -> 1385             return R(R.complex_field()(self)) 
> >>    1386 
> >>    1387     def __float__(self): 
> >> 
> >> 
> >> 
> /mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/rings/complex_field.pyc
>  
>
> >> in __call__(self, x, im) 
> >>     349         if im is not None: 
> >>     350             x = x, im 
> >> --> 351         return Parent.__call__(self, x) 
> >>     352 
> >>     353     def _element_constructor_(self, x): 
> >> 
> >> /mnt/disk/home/release/Sage/src/sage/structure/parent.pyx in 
> >> sage.structure.parent.Parent.__call__ 
> >> (build/cythonized/sage/structure/parent.c:9602)() 
> >>    1092         if mor is not None: 
> >>    1093             if no_extra_args: 
> >> -> 1094                 return mor._call_(x) 
> >>    1095             else: 
> >>    1096                 return mor._call_with_args(x, args, kwds) 
> >> 
> >> /mnt/disk/home/release/Sage/src/sage/structure/coerce_maps.pyx in 
> >> sage.structure.coerce_maps.DefaultConvertMap_unique._call_ 
> >> (build/cythonized/sage/structure/coerce_maps.c:4496)() 
> >>     108                 print type(C), C 
> >>     109                 print type(C._element_constructor), 
> >> C._element_constructor 
> >> --> 110             raise 
> >>     111 
> >>     112     cpdef Element _call_with_args(self, x, args=(), kwds={}): 
> >> 
> >> /mnt/disk/home/release/Sage/src/sage/structure/coerce_maps.pyx in 
> >> sage.structure.coerce_maps.DefaultConvertMap_unique._call_ 
> >> (build/cythonized/sage/structure/coerce_maps.c:4403)() 
> >>     103         cdef Parent C = self._codomain 
> >>     104         try: 
> >> --> 105             return C._element_constructor(x) 
> >>     106         except Exception: 
> >>     107             if print_warnings: 
> >> 
> >> 
> >> 
> /mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/rings/complex_field.pyc
>  
>
> >> in _element_constructor_(self, x) 
> >>     391             except AttributeError: 
> >>     392                 pass 
> >> --> 393         return complex_number.ComplexNumber(self, x) 
> >>     394 
> >>     395     def _coerce_map_from_(self, S): 
> >> 
> >> /mnt/disk/home/release/Sage/src/sage/rings/complex_number.pyx in 
> >> sage.rings.complex_number.ComplexNumber.__init__ 
> >> (build/cythonized/sage/rings/complex_number.c:4167)() 
> >>     182         try: 
> >>     183             R = parent._real_field() 
> >> --> 184             rr = R(real) 
> >>     185             ii = R(imag) 
> >>     186             mpfr_set(self.__re, rr.value, rnd) 
> >> 
> >> /mnt/disk/home/release/Sage/src/sage/structure/parent.pyx in 
> >> sage.structure.parent.Parent.__call__ 
> >> (build/cythonized/sage/structure/parent.c:9602)() 
> >>    1092         if mor is not None: 
> >>    1093             if no_extra_args: 
> >> -> 1094                 return mor._call_(x) 
> >>    1095             else: 
> >>    1096                 return mor._call_with_args(x, args, kwds) 
> >> 
> >> /mnt/disk/home/release/Sage/src/sage/structure/coerce_maps.pyx in 
> >> sage.structure.coerce_maps.NamedConvertMap._call_ 
> >> (build/cythonized/sage/structure/coerce_maps.c:5819)() 
> >>     236             raise TypeError("Cannot coerce {} to {}".format(x, 
> C)) 
> >>     237         cdef Map m 
> >> --> 238         cdef Element e = method(C) 
> >>     239         if e is None: 
> >>     240             raise RuntimeError("BUG in coercion model: {} 
> method 
> >> of {} returned None".format(self.method_name, type(x))) 
> >> 
> >> 
> >> 
> /mnt/disk/home/release/Sage/src/sage/rings/number_field/number_field_element.pyx
>  
>
> >> in 
> sage.rings.number_field.number_field_element.NumberFieldElement._mpfr_ 
> >> 
> (build/cythonized/sage/rings/number_field/number_field_element.cpp:15017)() 
> >>    1383             return R(self.base_ring()(self)) 
> >>    1384         else: 
> >> -> 1385             return R(R.complex_field()(self)) 
> >>    1386 
> >>    1387     def __float__(self): 
> >> 
> >> 
> >> 
> /mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/rings/complex_field.pyc
>  
>
> >> in __call__(self, x, im) 
> >>     349         if im is not None: 
> >>     350             x = x, im 
> >> --> 351         return Parent.__call__(self, x) 
> >>     352 
> >>     353     def _element_constructor_(self, x): 
> >> 
> >> /mnt/disk/home/release/Sage/src/sage/structure/parent.pyx in 
> >> sage.structure.parent.Parent.__call__ 
> >> (build/cythonized/sage/structure/parent.c:9602)() 
> >>    1092         if mor is not None: 
> >>    1093             if no_extra_args: 
> >> -> 1094                 return mor._call_(x) 
> >>    1095             else: 
> >>    1096                 return mor._call_with_args(x, args, kwds) 
> >> 
> >> /mnt/disk/home/release/Sage/src/sage/structure/coerce_maps.pyx in 
> >> sage.structure.coerce_maps.DefaultConvertMap_unique._call_ 
> >> (build/cythonized/sage/structure/coerce_maps.c:4496)() 
> >>     108                 print type(C), C 
> >>     109                 print type(C._element_constructor), 
> >> C._element_constructor 
> >> --> 110             raise 
> >>     111 
> >>     112     cpdef Element _call_with_args(self, x, args=(), kwds={}): 
> >> 
> >> /mnt/disk/home/release/Sage/src/sage/structure/coerce_maps.pyx in 
> >> sage.structure.coerce_maps.DefaultConvertMap_unique._call_ 
> >> (build/cythonized/sage/structure/coerce_maps.c:4403)() 
> >>     103         cdef Parent C = self._codomain 
> >>     104         try: 
> >> --> 105             return C._element_constructor(x) 
> >>     106         except Exception: 
> >>     107             if print_warnings: 
> >> 
> >> 
> >> 
> /mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/rings/complex_field.pyc
>  
>
> >> in _element_constructor_(self, x) 
> >>     391             except AttributeError: 
> >>     392                 pass 
> >> --> 393         return complex_number.ComplexNumber(self, x) 
> >>     394 
> >>     395     def _coerce_map_from_(self, S): 
> >> 
> >> /mnt/disk/home/release/Sage/src/sage/rings/complex_number.pyx in 
> >> sage.rings.complex_number.ComplexNumber.__init__ 
> >> (build/cythonized/sage/rings/complex_number.c:4167)() 
> >>     182         try: 
> >>     183             R = parent._real_field() 
> >> --> 184             rr = R(real) 
> >>     185             ii = R(imag) 
> >>     186             mpfr_set(self.__re, rr.value, rnd) 
> >> 
> >> /mnt/disk/home/release/Sage/src/sage/structure/parent.pyx in 
> >> sage.structure.parent.Parent.__call__ 
> >> (build/cythonized/sage/structure/parent.c:9602)() 
> >>    1092         if mor is not None: 
> >>    1093             if no_extra_args: 
> >> -> 1094                 return mor._call_(x) 
> >>    1095             else: 
> >>    1096                 return mor._call_with_args(x, args, kwds) 
> >> 
> >> /mnt/disk/home/release/Sage/src/sage/structure/coerce_maps.pyx in 
> >> sage.structure.coerce_maps.NamedConvertMap._call_ 
> >> (build/cythonized/sage/structure/coerce_maps.c:5819)() 
> >>     236             raise TypeError("Cannot coerce {} to {}".format(x, 
> C)) 
> >>     237         cdef Map m 
> >> --> 238         cdef Element e = method(C) 
> >>     239         if e is None: 
> >>     240             raise RuntimeError("BUG in coercion model: {} 
> method 
> >> of {} returned None".format(self.method_name, type(x))) 
> >> 
> >> 
> >> 
> /mnt/disk/home/release/Sage/src/sage/rings/number_field/number_field_element.pyx
>  
>
> >> in 
> sage.rings.number_field.number_field_element.NumberFieldElement._mpfr_ 
> >> 
> (build/cythonized/sage/rings/number_field/number_field_element.cpp:15017)() 
> >>    1383             return R(self.base_ring()(self)) 
> >>    1384         else: 
> >> -> 1385             return R(R.complex_field()(self)) 
> >>    1386 
> >>    1387     def __float__(self): 
> >> 
> >> 
> >> 
> /mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/rings/complex_field.pyc
>  
>
> >> in __call__(self, x, im) 
> >>     349         if im is not None: 
> >>     350             x = x, im 
> >> --> 351         return Parent.__call__(self, x) 
> >>     352 
> >>     353     def _element_constructor_(self, x): 
> >> 
> >> /mnt/disk/home/release/Sage/src/sage/structure/parent.pyx in 
> >> sage.structure.parent.Parent.__call__ 
> >> (build/cythonized/sage/structure/parent.c:9602)() 
> >>    1092         if mor is not None: 
> >>    1093             if no_extra_args: 
> >> -> 1094                 return mor._call_(x) 
> >>    1095             else: 
> >>    1096                 return mor._call_with_args(x, args, kwds) 
> >> 
> >> /mnt/disk/home/release/Sage/src/sage/structure/coerce_maps.pyx in 
> >> sage.structure.coerce_maps.DefaultConvertMap_unique._call_ 
> >> (build/cythonized/sage/structure/coerce_maps.c:4496)() 
> >>     108                 print type(C), C 
> >>     109                 print type(C._element_constructor), 
> >> C._element_constructor 
> >> --> 110             raise 
> >>     111 
> >>     112     cpdef Element _call_with_args(self, x, args=(), kwds={}): 
> >> 
> >> /mnt/disk/home/release/Sage/src/sage/structure/coerce_maps.pyx in 
> >> sage.structure.coerce_maps.DefaultConvertMap_unique._call_ 
> >> (build/cythonized/sage/structure/coerce_maps.c:4403)() 
> >>     103         cdef Parent C = self._codomain 
> >>     104         try: 
> >> --> 105             return C._element_constructor(x) 
> >>     106         except Exception: 
> >>     107             if print_warnings: 
> >> 
> >> 
> >> 
> /mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/rings/complex_field.pyc
>  
>
> >> in _element_constructor_(self, x) 
> >>     391             except AttributeError: 
> >>     392                 pass 
> >> --> 393         return complex_number.ComplexNumber(self, x) 
> >>     394 
> >>     395     def _coerce_map_from_(self, S): 
> >> 
> >> /mnt/disk/home/release/Sage/src/sage/rings/complex_number.pyx in 
> >> sage.rings.complex_number.ComplexNumber.__init__ 
> >> (build/cythonized/sage/rings/complex_number.c:4167)() 
> >>     182         try: 
> >>     183             R = parent._real_field() 
> >> --> 184             rr = R(real) 
> >>     185             ii = R(imag) 
> >>     186             mpfr_set(self.__re, rr.value, rnd) 
> >> 
> >> /mnt/disk/home/release/Sage/src/sage/structure/parent.pyx in 
> >> sage.structure.parent.Parent.__call__ 
> >> (build/cythonized/sage/structure/parent.c:9602)() 
> >>    1092         if mor is not None: 
> >>    1093             if no_extra_args: 
> >> -> 1094                 return mor._call_(x) 
> >>    1095             else: 
> >>    1096                 return mor._call_with_args(x, args, kwds) 
> >> 
> >> /mnt/disk/home/release/Sage/src/sage/structure/coerce_maps.pyx in 
> >> sage.structure.coerce_maps.NamedConvertMap._call_ 
> >> (build/cythonized/sage/structure/coerce_maps.c:5819)() 
> >>     236             raise TypeError("Cannot coerce {} to {}".format(x, 
> C)) 
> >>     237         cdef Map m 
> >> --> 238         cdef Element e = method(C) 
> >>     239         if e is None: 
> >>     240             raise RuntimeError("BUG in coercion model: {} 
> method 
> >> of {} returned None".format(self.method_name, type(x))) 
> >> 
> >> 
> >> 
> /mnt/disk/home/release/Sage/src/sage/rings/number_field/number_field_element.pyx
>  
>
> >> in 
> sage.rings.number_field.number_field_element.NumberFieldElement._mpfr_ 
> >> 
> (build/cythonized/sage/rings/number_field/number_field_element.cpp:15017)() 
> >>    1383             return R(self.base_ring()(self)) 
> >>    1384         else: 
> >> -> 1385             return R(R.complex_field()(self)) 
> >>    1386 
> >>    1387     def __float__(self): 
> >> 
> >> 
> >> 
> /mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/rings/complex_field.pyc
>  
>
> >> in __call__(self, x, im) 
> >>     349         if im is not None: 
> >>     350             x = x, im 
> >> --> 351         return Parent.__call__(self, x) 
> >>     352 
> >>     353     def _element_constructor_(self, x): 
> >> 
> >> /mnt/disk/home/release/Sage/src/sage/structure/parent.pyx in 
> >> sage.structure.parent.Parent.__call__ 
> >> (build/cythonized/sage/structure/parent.c:9602)() 
> >>    1092         if mor is not None: 
> >>    1093             if no_extra_args: 
> >> -> 1094                 return mor._call_(x) 
> >>    1095             else: 
> >>    1096                 return mor._call_with_args(x, args, kwds) 
> >> 
> >> /mnt/disk/home/release/Sage/src/sage/structure/coerce_maps.pyx in 
> >> sage.structure.coerce_maps.DefaultConvertMap_unique._call_ 
> >> (build/cythonized/sage/structure/coerce_maps.c:4496)() 
> >>     108                 print type(C), C 
> >>     109                 print type(C._element_constructor), 
> >> C._element_constructor 
> >> --> 110             raise 
> >>     111 
> >>     112     cpdef Element _call_with_args(self, x, args=(), kwds={}): 
> >> 
> >> /mnt/disk/home/release/Sage/src/sage/structure/coerce_maps.pyx in 
> >> sage.structure.coerce_maps.DefaultConvertMap_unique._call_ 
> >> (build/cythonized/sage/structure/coerce_maps.c:4403)() 
> >>     103         cdef Parent C = self._codomain 
> >>     104         try: 
> >> --> 105             return C._element_constructor(x) 
> >>     106         except Exception: 
> >>     107             if print_warnings: 
> >> 
> >> 
> >> 
> /mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/rings/complex_field.pyc
>  
>
> >> in _element_constructor_(self, x) 
> >>     391             except AttributeError: 
> >>     392                 pass 
> >> --> 393         return complex_number.ComplexNumber(self, x) 
> >>     394 
> >>     395     def _coerce_map_from_(self, S): 
> >> 
> >> /mnt/disk/home/release/Sage/src/sage/rings/complex_number.pyx in 
> >> sage.rings.complex_number.ComplexNumber.__init__ 
> >> (build/cythonized/sage/rings/complex_number.c:4167)() 
> >>     182         try: 
> >>     183             R = parent._real_field() 
> >> --> 184             rr = R(real) 
> >>     185             ii = R(imag) 
> >>     186             mpfr_set(self.__re, rr.value, rnd) 
> >> 
> >> /mnt/disk/home/release/Sage/src/sage/structure/parent.pyx in 
> >> sage.structure.parent.Parent.__call__ 
> >> (build/cythonized/sage/structure/parent.c:9602)() 
> >>    1092         if mor is not None: 
> >>    1093             if no_extra_args: 
> >> -> 1094                 return mor._call_(x) 
> >>    1095             else: 
> >>    1096                 return mor._call_with_args(x, args, kwds) 
> >> 
> >> /mnt/disk/home/release/Sage/src/sage/structure/coerce_maps.pyx in 
> >> sage.structure.coerce_maps.NamedConvertMap._call_ 
> >> (build/cythonized/sage/structure/coerce_maps.c:5819)() 
> >>     236             raise TypeError("Cannot coerce {} to {}".format(x, 
> C)) 
> >>     237         cdef Map m 
> >> --> 238         cdef Element e = method(C) 
> >>     239         if e is None: 
> >>     240             raise RuntimeError("BUG in coercion model: {} 
> method 
> >> of {} returned None".format(self.method_name, type(x))) 
> >> 
> >> 
> >> 
> /mnt/disk/home/release/Sage/src/sage/rings/number_field/number_field_element.pyx
>  
>
> >> in 
> sage.rings.number_field.number_field_element.NumberFieldElement._mpfr_ 
> >> 
> (build/cythonized/sage/rings/number_field/number_field_element.cpp:15017)() 
> >>    1383             return R(self.base_ring()(self)) 
> >>    1384         else: 
> >> -> 1385             return R(R.complex_field()(self)) 
> >>    1386 
> >>    1387     def __float__(self): 
> >> 
> >> 
> >> 
> /mnt/disk/home/release/Sage/local/lib/python2.7/site-packages/sage/rings/complex_field.pyc
>  
>
> >> in __call__(self, x, im) 
> >>     349         if im is not None: 
> >>     350             x = x, im 
> >> --> 351         return Parent.__call__(self, x) 
> >>     352 
> >>     353     def _element_constructor_(self, x): 
> >> 
> >> /mnt/disk/home/release/Sage/src/sage/structure/parent.pyx in 
> >> sage.structure.parent.Parent.__call__ 
> >> (build/cythonized/sage/structure/parent.c:9602)() 
> >>    1092         if mor is not None: 
> >>    1093             if no_extra_args: 
> >> -> 1094                 return mor._call_(x) 
> >>    1095             else: 
> >>    1096                 return mor._call_with_args(x, args, kwds) 
> >> 
> >> ... 
> >> 
> >> 
> >> /mnt/disk/home/release/Sage/src/sage/misc/cachefunc.pyx in 
> >> sage.misc.cachefunc.WeakCachedFunction.__call__ 
> >> (build/cythonized/sage/misc/cachefunc.c:7801)() 
> >>    1280             if self._argument_fixer is None: 
> >>    1281                 self.argfix_init() 
> >> -> 1282             k = self._fix_to_pos(*args, **kwds) 
> >>    1283         else: 
> >>    1284             if self._default_key is not None: 
> >> 
> >> RuntimeError: maximum recursion depth exceeded while calling a Python 
> >> object 
> >> sage: 
> >> 
> >> 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "sage-support" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to [email protected] <javascript:>. 
> > To post to this group, send email to [email protected] 
> <javascript:>. 
> > Visit this group at http://groups.google.com/group/sage-support. 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" 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-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to