On 2018-07-04 00:25, Nathaniel Smith wrote: > The only cases that seem potentially valuable to me are the ones that > are literally the form 'if <name> := <expr>` and 'while <name> := > <expr>'. (I suspect these are the only cases that I would allow in > code that I maintain.) The PEP does briefly discuss the alternative > proposal of restricting to just these two cases, but rejects it > because it would rule out code like 'if (<name> := <expr>) > <comparison> <expr>'. But those are exactly the cases that I want to > rule out, so that seems like a plus to me :-). > > The 'if <expr> as <name>' syntax would be a simple way to encode > exactly these simple non-harmful cases. The PEP rejects it on the > grounds that 'as' is already used in a different way by 'except' and > 'with'. But... 'as' is *also* used in the *same* way by 'import', so > the argument feels disingenuous. Yeah, there'd be an inconsistency, > but that inconsistency already exists, and adding 'if ... as' and > 'while ... as' wouldn't create any *new* inconsistencies. Agreed, tried to make this point in several threads. -Mike
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4