pep8online icon indicating copy to clipboard operation
pep8online copied to clipboard

Using outdated PEP8: Gives warning when breaking line before binary operator

Open billygarrison opened this issue 5 years ago • 0 comments

The recommended method changed and it is not recommend to break before the operator instead of after. Both are permissible as long as it is consistent throughout.

# No: operators sit far away from their operands
income = (gross_wages +
          taxable_interest +
          (dividends - qualified_dividends) -
          ira_deduction -
          student_loan_interest)
# Yes: easy to match operators with operands
income = (gross_wages
          + taxable_interest
          + (dividends - qualified_dividends)
          - ira_deduction
          - student_loan_interest)

billygarrison avatar Feb 05 '20 11:02 billygarrison