Jan. 13, 2022
8:57 a.m.
On Thu, Jan 13, 2022 at 06:41:14PM +1000, Nick Coghlan wrote:
If such a protocol were to be proposed, then int.__arrow__ could be defined such that "1 -> 100" was equivalent to "range(1, 100)"
Why? What's the benefit? It is slightly shorter, but no more clear than range. I would never guess that `1 -> 100` would mean a range object. I would think it was a transformation of 1 -> 100. In e.g. Ruby the equivalent of range has syntax 1...100, which matches how we write ranges of values in English. If we had an arrow operator beyond the typing proposal, I think it would be a terrible wasted opportunity to use it for something as unclear and trivial as a range object :-( -- Steve