[Python-ideas] Should range() == range(0)?
Terry Reedy
tjreedy at udel.edu
Mon May 7 19:04:17 CEST 2012
On 5/7/2012 7:14 AM, Nick Coghlan wrote:
> On Mon, May 7, 2012 at 8:50 PM, Georg Brandl<g.brandl at gmx.net> wrote:
>> For what gain? At the moment, I cannot think of any arguments in favor
>> of the change, which is the point where arguments against it aren't
>> even needed to keep the status quo.
>>
>> Ah yes: and I would rather have the bug
>>
>> for i in range(): #<- "n" (or equivalent) missing
>>
>> give me an explicit exception than silently "skipping" the loop.
>> After all, the primary use case for range() is loops, and we should not
>> make that use worse for the benefit of hypothetical other use cases.
>
> Now *that's* a good reason to nix the idea :)
I agree that the bug possibility is by far the strongest for range
whereas the usefulness is probably the weakest. So this seems a case of
practicality beats purity.
--
Terry Jan Reedy
More information about the Python-ideas
mailing list