Opened 11 years ago

Closed 9 years ago

#10960 closed defect (duplicate)

Better product error messages when can't multiply

Reported by: kcrisman Owned by: AlexGhitza
Priority: minor Milestone: sage-duplicate/invalid/wontfix
Component: basic arithmetic Keywords: multiply, arithmetic, coercion, incompatible
Cc: rbeezer, mjo Merged in:
Authors: Reviewers: Michael Orlitzky
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

See #10683, where the following less-than-helpful message was discovered.

sage: k.<b> = FiniteField(9); k
Finite Field in b of size 3^2
sage: vector([1,i]).dot_product(vector(k,[1,b]))
---------------------------------------------------------
ArithmeticError: 

Of course you can't multiply elements of the symbolic ring and this finite field. But if this happened buried deep in some other code, it could take a long time to track down.

This actually happens when you just multiply as well, unsurprisingly, so that's where it would have to be caught.

sage: k.<b> = FiniteField(9)
sage: i*b
<boom>

Change History (4)

comment:1 Changed 9 years ago by mjo

  • Cc mjo added

This is fixed by Burcin's patch in #13739. I just accidentally rebased it without noticing that it had a dependency, but I think the dependency is just for the line or two of context in the patch.

Anyway, I added the test case from this ticket, so when #13739 gets applied we can close this, too.

comment:2 Changed 9 years ago by mjo

  • Milestone set to sage-duplicate/invalid/wontfix
  • Reviewers set to Michael Orlitzky
  • Status changed from new to needs_review

The fix and doctest are both in, so this can be closed.

comment:3 Changed 9 years ago by mjo

  • Status changed from needs_review to positive_review

comment:4 Changed 9 years ago by jdemeyer

  • Resolution set to duplicate
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.