You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code from src/sage/categories/coercion_methods.pyx looks like a potential infinite loop:
if have_same_parent_c(self, right) and hasattr(self, "_add_"):
return self._add_(right)
return coercion_model.bin_op(self, right, operator.add)
The hasattr(self, "_add_") clause is bad: if there is no _add_, the coercion model will just call __add__, which calls the coercion model, which calls __add__...
Solution: remove the hasattr(self, "_add_").
Hopefully the whole module coercion_methods.pyx can be removed in #20767 and then the problem will disappear by itself.
This code from
src/sage/categories/coercion_methods.pyx
looks like a potential infinite loop:The
hasattr(self, "_add_")
clause is bad: if there is no_add_
, the coercion model will just call__add__
, which calls the coercion model, which calls__add__
...Solution: remove the
hasattr(self, "_add_")
.Hopefully the whole module
coercion_methods.pyx
can be removed in #20767 and then the problem will disappear by itself.CC: @nthiery
Component: categories
Reviewer: Jeroen Demeyer
Issue created by migration from https://trac.sagemath.org/ticket/20851
The text was updated successfully, but these errors were encountered: