[Python-Dev] conditional expressions - add parens? (original) (raw)
Jeremy Hylton jeremy at alum.mit.edu
Tue Mar 7 14:06:46 CET 2006
- Previous message: [Python-Dev] conditional expressions - add parens?
- Next message: [Python-Dev] conditional expressions - add parens?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 "absoluteimport" 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
- Previous message: [Python-Dev] conditional expressions - add parens?
- Next message: [Python-Dev] conditional expressions - add parens?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]