Martin McBride
1 min readAug 3, 2020

--

Do you have a reference for what you are saying? This method of line continuation is recommended is PEP-008, without any caveats about performance.

I thought that Python automatically ignores line breaks if it is waiting for a closing bracket of any kind. So it concatenates the lines, then parses it, without any effect on the code that is created.

In any case, (x) doesn't create a tuple, it is just x enclosed in redundant parentheses. You need to use (x,) to create a one element tuple.

--

--

Martin McBride
Martin McBride

Responses (1)