[Python-mode] Bug?
Barry Warsaw
barry at python.org
Fri Jun 14 23:20:50 CEST 2013
On Jun 14, 2013, at 05:04 PM, Felipe Reyes wrote:
>Hi All,
>
>On Fri, Jun 14, 2013 at 04:30:16PM -0400, Barry Warsaw wrote:
>> It's bad form to use parentheses in this situation, but it *is* legal. It
>> doesn't bother me if python-mode passive/aggressively discourage such bad
>> form, but others might disagree. OTOH, this, which is perfectly fine form,
>> seems to work well:
>>
>> def foo():
>> if (foo &&
>> baz):
>> bar()
>>
>> (i.e. parens used to span multiple lines.)
>
>This example raises a pep8 warning[0],
Note that PEP 8 doesn't really recommend against this. There's even an
example in the Maximum Line Length section that has this very "problem".
It's also true that there's no single convention or recommendation for dealing
with this.
>I've been dealing with it and manually
>adding another indentation level to not leave 'baz' aligned with 'baz()'
>
>def foo():
> if (foo &&
> baz):
> bar()
>
>Can this be considered a bug?
I think python-mode should be able to handle it, but it needs to be
configurable.
-Barry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-mode/attachments/20130614/8902254c/attachment.pgp>
More information about the Python-mode
mailing list