There are various questions about line continuations in Python, e.g., here, here and here, most pointing at the guidelines:
Continuation lines should align wrapped elements either vertically using Python's implicit line joining inside parentheses, brackets and braces, or using a hanging indent
Most of the specifics are around a long if statement, which can use parenthesis or implicit continuations if calling a function.
This begs the question, how should you deal with import statements?
Specifically, what else can I do with
from concurrent.futures import \
ProcessPoolExecutor
Is a line continuation my only option?
If you're only importing 1 thing from the package, you should continue to do it the way that you currently are.
If you're importing multiple things, do something like this:
from package_name import (
x,
y,
z,
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With