So I have the following line in python:
for category in SomeLongClass.license_categories:
data[f"Category {category}"], data[f"Category {category} Validity Date"], data[f"Category {category} Expiry Date"] = SomeLongClass.get_category_dates(text_lines=text_lines, category=category)
And as you can see this line is long and compromises on readability. I ran pylint on this file, and it just tells me that this line is long, but not how to remedy it. I tried googling it out, it says to just put a \
and break in a new line, but isn't that going to compromise readability more in this case?
How to go about formatting this line?
This is one way that my group at work would have done it: align the receiving variables, align the line continuations (not strictly PEP-8), and indent the RHS.
# Assign three return values to the desired variables.
data[f"Category {category}"], \
data[f"Category {category} Validity Date"], \
data[f"Category {category} Expiry Date"] = \
SomeLongClass.get_category_dates(text_lines=text_lines, category=category)