for / while else doesn't make sense

Bob Martin bob.martin at excite.com
Fri May 20 07:45:31 EDT 2016


in 759855 20160519 185500 Jon Ribbens <jon+usenet at unequivocal.co.uk> wrote:
>On 2016-05-19, Steven D'Aprano <steve at pearwood.info> wrote:
>> On Fri, 20 May 2016 02:31 am, Herkermer Sherwood wrote:
>>> Most keywords in Python make linguistic sense, but using "else" in for and
>>> while structures is kludgy and misleading. I am under the assumption that
>>> this was just utilizing an already existing keyword. Adding another like
>>> "andthen" would not be good.
>>
>> If I could steal the keys to Guido's time machine, I would go back in time
>> and change the for...else and while...else keywords to for...then and
>> while...then.
>
>I guess we should thank our lucky stars that you don't have a time
>machine then, since that change would very much be one for the worse
>in my opinion. for...else is perfectly straightforward and clearly
>the right keywords to use. for...then would be entirely wrong.

Yes.  "else" and "then" have opposite meanings.



More information about the Python-list mailing list