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
raiseValueError('A FiniteSet must be given, not %s: %s'%
(type(finite_set), finite_set))
The code assumes that any set that isn't a finite set is an intersection with two arguments, a finite set and another set. It also assumes that the finite set will be the second argument of the intersection.
If the algorithm can only work in this case, that is fine, but it should check the input to make sure that the object actually is what it thinks it is. Otherwise, it will produce wrong results.
The text was updated successfully, but these errors were encountered:
That is one type check, but there are other assumptions, like assuming that finset_intersection is an intersection and assuming it has exactly 2 args. Also, it should be able to handle the case where the finite set is first as well. Intersection sorts the sets by the infimum, so they can be in either order.
I noticed this when doing #16344.
In
not_empty_in
, there is this code:sympy/sympy/calculus/util.py
Lines 294 to 303 in f06edf4
The code assumes that any set that isn't a finite set is an intersection with two arguments, a finite set and another set. It also assumes that the finite set will be the second argument of the intersection.
If the algorithm can only work in this case, that is fine, but it should check the input to make sure that the object actually is what it thinks it is. Otherwise, it will produce wrong results.
The text was updated successfully, but these errors were encountered: