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.

Written by

I am a software developer with over 30 years experience in Java, Python and C++. I write for

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store