On Wed, Apr 25, 2018 at 12:58 AM, Yury Selivanov <yselivanov...@gmail.com> wrote: > On Tue, Apr 24, 2018 at 10:49 AM, Paul Moore <p.f.mo...@gmail.com> wrote: > [..] >>>> 3. Most importantly: it is *not* allowed to mask names in the current >>>> local scope. >>> >>> While I agree this would be unambiguous to a computer, I think for >>> most humans it would be experienced as a confusing set of arcane and >>> arbitrary rules about what "=" means in Python. >> >> Also, there's the ambiguity and potential for misreading in the >> opposite direction (accidentally *reading* = as == even though it >> isn't): >> >> if (diff = x - x_base) and (g = gcd(diff, n)) > 1: >> return g > > Since 'diff' and 'g' must be new names according to rule (3), those > who read the code will notice that both were not previously bound. > Therefore both are new variables so it can't be a comparison.
That would not be true if this code were in a loop. Or do you have a different definition of "not previously bound" that is actually a syntactic feature? For instance: if (x = 1): x = 2 Legal? Not legal? ChrisA _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com