[Python-ideas] Simpler syntax for basic iterations

Steven D'Aprano steve at pearwood.info
Wed Oct 14 02:01:12 CEST 2015


On Wed, Oct 14, 2015 at 06:49:39AM +1100, Ben Finney wrote:
[...]
> Whereas ‘__’ is not a normal name, and like other unusual names in
> Python should lead the reader to say “Okay, obviously the person writing
> this had something odd in mind. I'd better find out what.” That is more
> likely to teach about the ‘__’ convention, than to be seen as a mistake
> by experienced programmers.

I'd just like to point out that using __ as a loop variable (or any 
other variable) is incompatible with the IPython convention for __. It 
is just wrong to talk about "the" __ convention, since there are at 
least two in common use, and using one necessarily conflicts with using 
the other.

If anyone wants to argue the pros and cons of one convention versus the 
other, or what unused loop variables ought to be called (x, unused, 
each, _, __, dontcare, whatever...) please take it to 
python-list at python.org or comp.lang.python, as it is off-topic here.

Thanks,


-- 
Steve


More information about the Python-ideas mailing list