PEP8 says:
The preferred way of wrapping long lines is by using Python's implied line continuation inside parentheses, brackets and braces.
And the section on Indentation gives a few examples on the possibilities. How you actually do it depends on your taste.
My favourites are:
# if you need to save lines:
category = relationship(Category,
backref=backref('items', cascade='all, delete'))
# if you need it more structured:
category = relationship(
Category, backref=backref('items', cascade='all, delete')
)
# if you have space and want a good overview:
category = relationship(
Category,
backref=backref('items', cascade='all, delete')
)
I personally most often use the last option because it visually corresponds to the nesting structure of the code.