[Python-ideas] Simpler syntax for basic iterations

John Wong gokoproject at gmail.com
Thu Oct 15 23:29:57 CEST 2015


On Wed, Oct 14, 2015 at 12:10 AM, Terry Reedy <tjreedy at udel.edu> wrote:
>
> This spelling was just suggested as an alternative to the original
>> poster who did not like having to explain the cryptic "___" spelling to
>> students.
>>
>
> What I think will not and should not happen is that Guido and/or core devs
> 'bless' in PEP 8 any particular work for teaching beginners.  Mark gets a
> bit over-anxious sometimes, but insofar as he meant 'its futile for us to
> try to decide on one spelling here', I think he is correct.
>
> Same construct, different spelling.
>>
>
> Right, and I think 'each' if better than '_' or '__' for beginners.  I
> recommend 'count' for range() and 'item' for a generic iterable.  I also
> recommend that teachers of beginners experiment with various choices, and
> share their experiences with each other. Who knows, maybe kids would prefer
> 'for kangaroo in range(3):', or other personal choices.
>
>
If a student is asking _ then it should be explained. Soon or later the
students will probably see _ in other source code. Whether it is a 4-year
old child or a 18 year-old college freshman. I wouldn't expect my nephew to
understand everything I write, but they will grow up and have the "ah"
moment.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20151015/27832ac7/attachment.html>


More information about the Python-ideas mailing list