
Aug. 3, 2022
12:23 p.m.
On Mon, Aug 1, 2022, at 09:19, Paul Moore wrote:
There are a lot of complex cases you'd need to consider. What would the value of range(3, 15, 2) + range(8, 12, 2) be? It's not a range in the sense of being describable as (start, end, step). And simply saying "that's not allowed" wouldn't really work, as it would be far too hard to work with if operations could fail unexpectedly like this. In reality, this feels more like you're after set algebra, which Python already has.
Maybe it would make sense for the type of the result to devolve into a sorted set (do we have a sorted set type now?) if it's not representable as a range.