An Emacs mode for editing Python code

Parens span multiple lines

Reported by Andreas Roehler on 2013-06-15
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-mode.el
Medium
Andreas Roehler

Bug Description

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
>
>
>

Changed in python-mode:
milestone: none → 6.1.2
assignee: nobody → Andreas Roehler (a-roehler)
importance: Undecided → Medium
summary: - parens span multiple lines
+ Parens span multiple lines
description: updated
description: updated
Changed in python-mode:
status: New → Fix Committed
Changed in python-mode:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers