FWIW, the combination of limiting the PEP to binding expressions and the motivating example of sequential if/elif tests that each need to utilize an expression in their body (e.g. matching various regexen by narrowing, avoiding repeated indent) gets me to +1. I still think the edge case changes to comprehension semantics is needless for this PEP. However, it concerns a situation I don't think I've ever encountered in the wild, and certainly never relied on the old admittedly odd behavior. On Thu, Apr 26, 2018, 2:01 AM Tim Peters <tim.peters at gmail.com> wrote: > Yes, binding expressions in the current PEP support an extremely > limited subset of what Python's assignment statements support.[...] > Guido's if/elif/elif/elif/ ... complex text-processing example didn't, > but because the current lack of an ability to bind-and-test in one > gulp forced the `elif` parts to be ever-more-deeply-indented `if` > blocks instead. > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20180426/80c1683d/attachment.html>
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