Opened 6 years ago

Closed 2 years ago

#20850 closed defect (invalid)

AdditiveMagmas.ParentMethods.summation calls _add_ without checking

Reported by: Jeroen Demeyer Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: categories Keywords:
Cc: Nicolas M. Thiéry, Travis Scrimshaw Merged in:
Authors: Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by Jeroen Demeyer)

In src/sage/categories/additive_magmas.py, there is

class AdditiveMagmas(Category_singleton):
    class ParentMethods:
        def summation(self, x, y):
            return x._add_(y)

It's dangerous to call _add_ without checking. Either this should just be x + y, or there should be type checking for x and y, or there should be conversion of x and y to the correct parent.

Change History (6)

comment:1 Changed 6 years ago by Jeroen Demeyer

Cc: Vincent Delecroix removed

comment:2 Changed 6 years ago by Jeroen Demeyer

Description: modified (diff)

comment:3 Changed 2 years ago by Matthias Köppe

Cc: Travis Scrimshaw added
Milestone: sage-7.3sage-duplicate/invalid/wontfix
Status: newneeds_review

This is outdated; the code has changed since

comment:4 Changed 2 years ago by Travis Scrimshaw

Status: needs_reviewpositive_review

comment:5 Changed 2 years ago by Travis Scrimshaw

Reviewers: Travis Scrimshaw

comment:6 Changed 2 years ago by Samuel Lelièvre

Resolution: invalid
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.