On Sat, 12 Aug 2017 12:45 am, Michael Torrie wrote: > On 08/10/2017 11:29 PM, Steve D'Aprano wrote: >> On Fri, 11 Aug 2017 12:54 pm, Mikhail V wrote: >> >>> but at a first glance, "while" reads as "if" as in english. >> >> In English the two words don't mean the same thing. > But actually in some contexts they really do seem to mean the same thing: > > Make hay while the sun shines. > If it's sunny, make hay. > > Essentially the same meaning, though we can argue whether "while" > implies some kind of long-running activity that the if does not.
We really shouldn't argue about that, because that is the crux of the difference. If \If\, conj. 1. In case that; granting, allowing, or supposing that; -- introducing a condition or supposition. [1913 Webster] While \While\, conj. 1. During the time that; as long as; whilst; at the same time that; as, while I write, you sleep. "While I have time and space." --Chaucer. [1913 Webster] Of course there is overlap: both are conjunctions, both depend on a condition, but the fundamental difference is that of duration. Your two examples are not actually equivalent: "Make hay while the sun shines" implies that making hay is a process you can continue for as long as the sun continues to shine; "If it's sunny, make hay" implies that making hay is a once-off job that you do once, provided it is sunny, and then go on to do other things even if it remains sunny. And that is why the English proverb is the first, not the second. -- Steve “Cheer up,” they said, “things could be worse.” So I cheered up, and sure enough, things got worse. -- https://mail.python.org/mailman/listinfo/python-list