On 14May2018 02:04, Steven D'Aprano <st...@pearwood.info> wrote:
"Outer parentheses" is a red herring. I should have written:

   (x + x) given x = 50  # this ought to return 100
   x + (x given x = 50)  # this ought to return 51

and now there are no outer parentheses to worry about. The question is
now whether "given" binds more tightly than + or not.

Just to this: as a general principle I think "words" should bind less tightly than "punctuationlike operators".

Certainly for myself I read most code as "words surrounding expressions". While "given" and "for (comprehension)" and so forth are all words within expressions as far as the language grammar goes, to my intuition and _visually_ they are bulky separators between terse "mathy" things. Even the Boolean words "and", "or", "not"...) fit this role.

So as a matter of egonomic design "given" ought also to bind less tightly than "+". Arithmetic before logic before declaration before control, if you like.

Cheers,
Cameron Simpson <c...@cskk.id.au>
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to