[issue42895] Return multi-line list concatenation without parentheses returns only first operand
Steven D'Aprano
report at bugs.python.org
Mon Jan 11 15:37:16 EST 2021
Steven D'Aprano <steve+python at pearwood.info> added the comment:
As Guido says, a full explanation will have to to a user-forum such as https://discuss.python.org/c/users/7 but consider this example and see if it gives you insight:
def demo():
x = 1
return (
x - 1
)
print("This is not executed.")
- (5 * x)
and remember that `+` can also be a unary operator.
----------
nosy: +steven.daprano
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42895>
_______________________________________
More information about the Python-bugs-list
mailing list