Allow Range to accept Infinites

On Fri, Jul 18, 2014 at 10:23:20AM -0700, Harsh Gupta wrote:
>    In sympy/sets/fancysets.py:
> 
>  >
>  > -        return Basic.__new__(cls, start, stop + step, step)
>  > +        step = abs(step)
>  > +        stop = stop + step
>  > +        if start is S.NegativeInfinity and stop is S.Infinity:
>  > +            return S.Integers
> 
>      I think, this will depend on the step value...
> 
>    It won't. Suppose we have Range(-oo, oo, 3) it is same as Range(-oo, 0, 3)
>    U Range(0, oo, 3)

Oh, I see.  Then things got worse: there is an ambiguity in this syntax.

>    hence all numbers of form 3k will be members of
>    Range(-oo, oo, 3). Similarly Range(-oo, oo, 3) is also same as Range(-oo,
>    1, 3) U Range(1, oo, 3) hence all numbers of form 3k + 1 are also members
>    of Range(-oo, oo, 3).

But 3k set != 3k + 1 set!

>    I should also add an explanation as a comment in the code, lest someone else
>    looking at the code thinks of it as a bug.

No.  You just shouldn't allow this case (i.e. both start=-oo and stop=oo).