utilities.iterables.iterable(Naturals)
returns True
even though it's infinite. #25992
Open
Description
sympy/sympy/utilities/iterables.py
Lines 3026 to 3030 in 5804781
In [15]: from sympy.utilities.iterables import iterable
In [16]: iterable(Naturals)
Out[16]: True
In [17]: solveset(sin(x))
Out[17]: {2⋅n⋅π │ n ∊ ℤ} ∪ {2⋅n⋅π + π │ n ∊ ℤ}
In [18]: iterable(_)
Out[18]: True
Insufficient checking in function_range
can lead to an infinite loop:
Lines 267 to 272 in 5804781
(For a PR I'm working on I'm hitting this issue with a
Union
of ImageSets
. I'll improve the check, but I may leave a more complete fix for later.)