pep8online
pep8online copied to clipboard
Using outdated PEP8: Gives warning when breaking line before binary operator
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)