Opened 5 years ago

Closed 5 years ago

#21007 closed defect (fixed)

Unhelpful error when conversion to Symbolic Ring fails

Reported by: rws Owned by:
Priority: trivial Milestone: sage-7.3
Component: symbolics Keywords:
Cc: Merged in:
Authors: Jeroen Demeyer Reviewers: Ralf Stephan
Report Upstream: N/A Work issues:
Branch: 8d25768 (Commits, GitHub, GitLab) Commit: 8d25768d4de8ca0664a3dd1e502371ec35c5243f
Dependencies: Stopgaps:

Status badges


sage: 1/r^(1/3)
/home/ralf/sage/src/sage/symbolic/ring.pyx in sage.symbolic.ring.SymbolicRing._element_constructor_ (build/cythonized/sage/symbolic/ring.cpp:6620)()
    340             return prod([SR(p)**e for p,e in x], SR(x.unit()))
    341         else:
--> 342             raise TypeError
    344         return new_Expression_from_GEx(self, exp)


Fresh Sage has r defined as the R interpreter. Granted I only stumbled over this only after years but still, this exception should print r like when you do r+1 and get TypeError: unsupported operand parent(s) for '+': '<class 'sage.interfaces.r.R'>' and 'Integer Ring'.

Change History (7)

comment:1 Changed 5 years ago by jdemeyer

  • Authors set to Jeroen Demeyer
  • Priority changed from major to trivial
  • Summary changed from Unhelpful error when using "r" as symbolic variable to Unhelpful error when conversion to Symbolic Ring fails

comment:2 Changed 5 years ago by jdemeyer

  • Branch set to u/jdemeyer/unhelpful_error_when_conversion_to_symbolic_ring_fails

comment:3 Changed 5 years ago by jdemeyer

  • Commit set to 8d25768d4de8ca0664a3dd1e502371ec35c5243f
  • Status changed from new to needs_review

New commits:

8d25768Improve error message when conversion to SR fails

comment:4 Changed 5 years ago by rws

  • Reviewers set to Ralf Stephan

Is fine. Please set positive after patchbot is happy.

comment:5 Changed 5 years ago by jdemeyer

  • Status changed from needs_review to positive_review

comment:6 Changed 5 years ago by jdemeyer

Patchbot is down, but I ran doctests myself.

comment:7 Changed 5 years ago by vbraun

  • Branch changed from u/jdemeyer/unhelpful_error_when_conversion_to_symbolic_ring_fails to 8d25768d4de8ca0664a3dd1e502371ec35c5243f
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.