What is the purpose of a backslash at the end of a line?

Yep, it’s exactly the same and this is the point of the backslash — it escapes the newline, allowing this long line to be split in two. An alternative is to use parentheses:

from sqlalchemy.ext.declarative import (declarative_base,
      AbstractConcreteBase)

While this is a syntax error:

from sqlalchemy.ext.declarative import declarative_base,
      AbstractConcreteBase

Leave a Comment