With parentheses, we can use "if cond then val1 else val2" form without the burden of hacking the parser, although the cost of the keyword "then" is still there. so, some possible forms that prompts in my mind are level = (if "absolute_import" in self.future then 0 else -1) level = (if "absolute_import" in self.future: 0 else: -1) level = (0 if "absolute_import" in self.future else -1) -Jiwon On 3/7/06, Jeremy Hylton <jeremy at alum.mit.edu> wrote: > On 3/6/06, Alex Martelli <aleaxit at gmail.com> wrote: > > > > On Mar 6, 2006, at 9:17 AM, Jim Jewett wrote: > > ... > > > I think that adding parentheses would help, by at least signalling > > > that the logic is longer than just the next (single) expression. > > > > > > level = (0 if "absolute_import" in self.futures else -1) > > > > +1 (just because I can't give it +3.1415926...!!!). *Mandatory* > > parentheses make this form MUCH more readable. > > Recent language features seem to be suffereing from excessive > parenthesisitis. I worry that people will stop remembering which > expressions requirement parens in which context. Perhaps the solution > is to require parens around all expressions, a simple consistent rule. > If so, then adding parens around all statements is a fairly natural > extension, which solves a number of problems like how to make a richer > lambda. > > Jeremy > _______________________________________________ > Python-Dev mailing list > Python-Dev at python.org > http://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: http://mail.python.org/mailman/options/python-dev/seojiwon%40gmail.com >
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