[Python-ideas] range() manipulations

2022-08-01 Thread arvindsistla
Hello everyone. First time here, so please be forgiving of any missteps on my part. This is an idea I have thought about for a while, and I believe it could be quite useful. Would it be possible to enhance the standard range() type to allow for elementary operations on ranges? For example : ra

[Python-ideas] Re: range() manipulations

2022-08-01 Thread Paul Moore
On Mon, 1 Aug 2022 at 13:50, wrote: > Hello everyone. First time here, so please be forgiving of any missteps on > my part. > This is an idea I have thought about for a while, and I believe it could > be quite useful. > Would it be possible to enhance the standard range() type to allow for > elem

[Python-ideas] Re: range() manipulations

2022-08-01 Thread Christopher Barker
> For cases where the number of elements in the range is not ridiculously > large, simply converting to sets is probably sufficient: > Sets don’t preserve order, which may or may not be important— but as the IP didn’t provide a use case, I have no idea. To the OP: this idea isn’t likely y on be

[Python-ideas] Re: range() manipulations

2022-08-01 Thread arvindsistla
Thanks so much Christopher. I have several ideas for use cases, but you're right, it's probably better off as a library. That's exactly what I'll do now. ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to python-idea

[Python-ideas] Re: range() manipulations

2022-08-01 Thread arvindsistla
You're right, sets does make sense in these specific use cases, but I want to preserve order too. You're also right, a custom class is a much better idea. Thanks so much. ___ Python-ideas mailing list -- [email protected] To unsubscribe send an em

[Python-ideas] Re: range() manipulations

2022-08-01 Thread Oscar Benjamin
On Mon, 1 Aug 2022 at 13:50, wrote: > > Hello everyone. First time here, so please be forgiving of any missteps on my > part. > This is an idea I have thought about for a while, and I believe it could be > quite useful. > Would it be possible to enhance the standard range() type to allow for >