On Fri, Apr 13, 2018 at 4:27 PM, Ethan Furman <et...@stoneleaf.us> wrote: > On 04/12/2018 09:52 PM, Chris Angelico wrote: > >> foo := a > b # does this capture 'a', or 'a > b'? >> bar := c + d # 'c' or 'c + d'? >> >> I'm open to argument here, but my thinking is that these should >> capture 'a' and 'c + d'. > > > I think := should act the same as = or there will be plenty of confusion. > If one wants to capture less then parenthesis can be used to narrow it down: > > (foo := a) > b > > Looked at another way -- you already have the value named as 'a', so why > would you also name it as 'foo'? >
More likely, 'a' won't be a simple name lookup, but a function call. Consider: pos = -1 while pos := buffer.find(search_term, pos + 1) >= 0: ... Once find() returns -1, the loop terminates. Should this need to be parenthesized? ChrisA _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/