[Steven D'Aprano <steve at pearwood.info>] > ... > If we could look forward to 2028, when we're running Python 3.14 or so > (4.7 if you prefer), how many fantastic language features that we cannot > bear to give up would we be missing out on? This, for just one: k = 6 if >!{myobj.meth(arg)[2]} elsenone 7 elsenan 8 else 5 Which is really annoying to write today, but would be much clearer with binding expressions: if myobj is None: k = 7 elif (t := myobj.meth) is None: k = 7 elif (t := t(arg)) is None: k = 7 elif (t := t[2]) is None: k = 7 eiif math.isnan(t): k = 8 elif t: k = 6 else: k = 5 The future is blindingly bright :-)
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