<br><div><span class="gmail_quote">On 3/6/06, <b class="gmail_sendername">Jim Jewett</b> <<a href="mailto:jimjjewett@gmail.com">jimjjewett@gmail.com</a>> wrote:</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="direction: ltr;">From a recent checkin --
<br><br> level = 0 if "absolute_import" in self.futures else -1<br><br>Mentally, I can't help parsing that as "level = 0" plus comments that turn out to be code that triggers backracking.<br><br>When the expressions (particularly the true case) are longer, it gets even worse.
<br><br>I think that adding parentheses would help, by at least signalling that the logic is longer than just the next (single) expression.<br><br> level = (0 if "absolute_import" in self.futures else -1)</div>
</blockquote><div><br>I'm not sure, are you suggesting the grammar/parser enforces it that way, or that it should be in PEP-8?<br></div></div><br>(I still can't help but go 'yecchh' whenever I see the code. It looks like Perl's 'expr if expr' form, but it behaves quite different. Right now, removing if/else expressions still looks like the best solution, to me :-> But gauging reactions (my own and others) to the actual if-expr in use is the main reason I added those couple of lines to the compiler package.)
<br><br>-- <br>Thomas Wouters <<a href="mailto:thomas@python.org">thomas@python.org</a>><br><br>Hi! I'm a .signature virus! copy me into your .signature file to help me spread!