On Wed, May 09, 2018 at 05:44:57AM +0000, Steven D'Aprano wrote: > > On Tue, May 08, 2018 at 12:45:29AM +0000, Steven D'Aprano wrote: > >> Currently, the real reason is that lambda expressions are limited to a > >> single expression as the body of the function, and binding operations > >> in Python are statements. > > > > ...which begs the question, why shouldn't assignments be expressions, as > > they are in many other languages? TBH this is one of the few things > > about Python that I dislike. > > No, it raises the question :-) Begging the question means to assume the > answer to the same question you are asking.
In formal logic perhaps, but not in colloquial speech. Search google for "beg the question"--what it will give you is exactly how I used it. [The question is begged for on account of being the obvious question to ask...] > As Chris already pointed out, there is a PEP in progress at the moment > aimed at allowing assignment expressions (PEP 572). It is very > controversial, but Guido appears to be in favour of it (as I am, although > not necessarily in its current form). Well, obviously I'm a fan of the idea... > If all programmers were as awesome as you and never made typos, the world > would be a better place. HA! I make plenty of mistakes, but I think it's fair to say that when most reasonably competent programmers have a bit of experience under their belt, some bug or other has bitten them enough as fledgelings that they become paranoid about it and just never do it again. It does seem that for many of my contemporaries, this is one of those... When I took C ages ago the text I used had a "pitfalls" section at the end of every major section, and this was one of the items it mentioned. I do think having been exposed to those ideas so early greatly benefieted me in this regard, and I've found it sorely lacking in many programming texts I've read in the many years since. Perhaps an insufficient focus on programming pitfalls in modern programs is the reason we're in this mess... -- https://mail.python.org/mailman/listinfo/python-list